GetDropDownWithInsertReferenceValue
Gets the value of the specified DropDownWithInsertReference user control.
Syntax
function SetDropDownWithInsertReferenceValue(clientId)
Parameters
- clientId
- Type: String
The control ID of the control.
Returns
Type: String
The value of the selected option or input value, or an empty string ("") if no option or input value was specified.
Remarks
This function attempts to find a value in the options available to the specified DropDownWithInsertReference user control and, if found, sets the selected index of the control to that value.
Invoking this function performs the following actions:
-
Attempts to locate a valid DropDownWithInsertReference control, using the control ID specified in clientID.
-
If the control is found, the function checks if the "Other value..." option has been selected in the InputDropDownList control for the control.
-
If the "Other value..." option is selected, the function returns the value of the SingleLineInput control for the control.
-
If the "Other value..." option is not selected, the function checks if the selectedIndex property of the control is set to -1, indicating that an option has not been selected.
-
If an option has not been selected, the function returns an empty string (""); otherwise, the function returns the value of the selected option.
Example
The following example demonstrates how to use this function to set the value of an action parameter to the value of a DropDownWithInsertReference control, in the TPAWriteConfig function for a custom workflow action.
configXml.selectSingleNode("/NWActionConfig/Parameters/Parameter[@Name='State']/PrimitiveValue/@Value").text = GetDropDownWithInsertReferenceValue("<%= fieldState.ClientID %>");
See Also
Concepts
Operations
Working with the ContentHead control