This is the login panel



Return to Product Support > Learning Center > Developer References

Creating Forms with Multiple Select Fields

A multiple select form field is a select list that the user can hold down control and pick multiple items. They can be an alternative to checkboxes when the real estate on the select form is limited.

There is a issue with developing multiple select fields because different scripting platforms, on which Contensive runs, handle multiple select responses differently. As a result, Contensive has adopted a standard that works on either. The compromise is important so add-ons developed for php sites will still run on asp and aspx sites.

Creating the Form Field

The name of the field field should end with square brackets. For instance, if your multiple select field is a list of states:

<input multiple name="stateIdList[]">
<option value="1">New York</option>
<option value="2">California</option>

Processing the Response

To get the values from the field, be sure to include the square brakets in the field name

string stateIdList = cp.doc.getproperty( "stateidList[]" )

This returns a comma delimited list of values. The limitatiion here that you have to work around is that your option values should not contain a comma.