Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > ColdFusion > Re: preserving ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 2 Topic 1622 of 1699
Post > Topic >>

Re: preserving multiple values

by Peter Tilbrook <peter.tilbrook@[EMAIL PROTECTED] > Oct 27, 2006 at 07:26 PM

<cfdump var="#Form#">

<cfdump var="#Form#">

<cfform action="test.cfm" method="post" 
enctype="application/x-www-form-urlencoded" name="test">

	<cfselect enabled="Yes" name="testselect" size="6" multiple="yes">
	<option value="1">First</option>
	<option value="2">Second</option>
	<option value="3" selected>Third</option>
	<option value="4">Fourth</option>
	<option value="5">Fifth</option>
	<option value="6">Sixth</option>
	</cfselect>

	<cfinput name="submit" type="submit" label="Submit Form">

</cfform>

Displays a list of options. List generated (as variable testselect) is 
made up of the VALUE attribute of the option tags). The example above 
selects a default value (in this case Third) so as to avoid an error if 
they do not choose a option by default.

The example below does not pre-select a value and will re****t an error 
if at least one selection from the list is not made.

<cfdump var="#Form#">

<cfform action="test.cfm" method="post" 
enctype="application/x-www-form-urlencoded" name="test" preloader="no">

	<cfselect enabled="Yes" name="testselect" size="6" multiple="yes" 
required="yes" message="Make a selection please">
	<option value="1">First</option>
	<option value="2">Second</option>
	<option value="3">Third</option>
	<option value="4">Fourth</option>
	<option value="5">Fifth</option>
	<option value="6">Sixth</option>
	</cfselect>

	<cfinput name="submit" type="submit" label="Submit Form">

</cfform>

Hope that helps!

PT
Manager, ACT and Region ColdFusion Users Group
 




 2 Posts in Topic:
preserving multiple values
"HandersonVA" &  2006-10-26 06:29:33 
Re: preserving multiple values
Peter Tilbrook <peter.  2006-10-27 19:26:15 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Mon Oct 6 15:57:09 CDT 2008.