Heads Up :
The post you are writing will appear in a public forum. Please ensure all content is appropriate for public consumption. Review the employee guidelines for the community here.
Created by: Cindy Brozyno on 01-02-2012 07:51:50 AM I'm building a service that will pass a UserID (qsp) from one page to the next. The UserID is queried on the next page by sql. If someone accidentally hits submit without entering any information, the phone displays an html error. My solution at this point is to utilize a default value of 'space'; however, this is not a recommended solution. Placing 0 as a default value would solve the query issue; however, I cannot have default values visible on the screen. Is there any way to pass a null value? Any help is appreciated. Thank you. Cindy function InputMenu() { //Phone menu. Gets User ID (input) and forwards to next page. Response.Write("<CiscoIPPhoneInput>\r\n"); Response.Write("<Title>IP Time Clock</Title><Prompt>Enter UserID to Clock In</Prompt>\r\n"); Response.Write("<URL>http://"+serverIP+"/"+SERVICE_DIR+"/timeclock/CIAddPin.asp</URL>\r\n"); Response.Write("<InputItem>\r\n"); Response.Write("<DisplayName>User ID</DisplayName>\r\n"); Response.Write("<QueryStringParam>input</QueryStringParam>\r\n"); Response.Write("<DefaultValue> </DefaultValue>\r\n"); Response.Write("<InputFlags>N</InputFlags>\r\n"); Response.Write("</InputItem>\r\n"); Response.Write("</CiscoIPPhoneInput>\r\n"); return; } Next Page code snippet - to give you an idea of how the value above is being used var SERVICE_DIR="CiscoIPServices"; var serverIP = Request.ServerVariables("LOCAL_ADDR"); var input = Request.QueryString("input"); var sql; var Conn = Server.CreateObject("ADODB.Connection"); var RS = Server.CreateObject("ADODB.Recordset"); Conn.Open("Provider=SQLNCLI10;xxxx); var RS = Server.CreateObject("ADODB.Recordset"); sql=("SELECT * FROM dbo.vw_User_PinList WHERE PERSON_ID =("+input+") "); RS.Open(sql, Conn);
Subject: RE: passing null querystringparam Replied by: David Staudt on 10-02-2012 05:33:15 PM Can you not just leave the default value empty? The URL request will have either '?input=' or be missing the input parameter entirely (depending on phone model), which you should be able to check for in your server side code: http://stackoverflow.com/questions/1890438/how-to-get-parameters-from-the-url-with-jsp
Subject: RE: passing null querystringparam Replied by: Cindy Brozyno on 18-02-2012 01:43:21 PM After reviewing the schema, I found that querystringparams minimum value = 1. So leaving an empty space will work, but cannot accept null.
Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: