Get Value From Query String
Definition:
NDLLibrary.getValueFromQuerystring(urlParamName)
Description:
Obtain the parameter values specified in the URL used to call the form, if any.
Parameters:
This function has one parameter:
urlParamName - Required
The name of the parameter whose value you want to retrieve. The name is case-sensitive.
Note: This function does not use the default ndlParams object.
Returns:
The value of the specified URL parameter.
Null if parameter not found.
Code Sample 1:
var urlParamName = "param1";
return NDLLibrary.getValueFromQuerystring(urlParamName);
Code Sample 2:
form1.page1.ndltextbox1.value = NDLLibrary.getValueFromQuerystring("param1");
Code Sample 3:
var customerName;
customerName = NDLLibrary.getValueFromQuerystring("param2");
Notes:
When calling a form you can include parameter values in the URL used to call the form, in the format:
?<parameter name>=<value>&<parameter name>=<value>...
If such parameters are included, you can use getValueFromQuerystring to retrieve the values in these parameters, one at a time.
Using as Predefined Action in Event:
When assigned to an Event as a predefined action, you will need to generate a JavaScript function and then edit the skeleton script to specify the parameter you want to retrieve. Edit the automatically generated code:
return NDLLibrary.getValueFromQuerystring(ndlParamsName);
so it matches the two lines shown in Code Sample 1 above, replacing param1 with the actual parameter name, leaving the double quotes around it.
Alternatively you can enter the parameter name directly in the original code, in place of ndlParams, e.g.:
return NDLLibrary.getValueFromQuerystring("param1");
Note that if you enter the name directly, it must be surrounded by double quotes.