Quick and dirty fix...

In the processing page, add this to the top:

<cfparam name="form.unit_id_other" default="">

Steve

-----Original Message-----
From: Andy Matthews [mailto:li...@commadelimited.com] 
Sent: Wednesday, November 04, 2009 1:16 PM
To: cf-talk
Subject: RE: Form Insanity


With radio buttons, checkboxes, and multiple select dropdowns it doesn't
matter if the form is there on the view page. If no one selects one of
the
options in those input fields, the key doesn't exist in the form.

Use cfparam, or StructKeyExists(FORM,'key') to make sure it's there
before
using it.


andy 

-----Original Message-----
From: Timothy Laureska [mailto:tlaure...@dhmh.state.md.us] 
Sent: Wednesday, November 04, 2009 12:00 PM
To: cf-talk
Subject: Form Insanity


Hello:
 
Can somebody tell me why this from select box form and processing
template
produce the message that  "Element UNIT_ID_OTHER" is undefined in form"
 
<form>
<select name="unit_id_other" multiple="yes"> <option value="">Select
Unit
(if applicable) <option value="">----------------------------------
<cfoutput query="list_units">
<option value="#unit_id#">#unit_name#
</cfoutput>
</select>
</form>
 
processing template
 
<cfif #form.unit_id_other# IS NOT "">
<cfquery datasource="#datasource#" name="find_other_unit"> SELECT * FROM
dhmh_units where unit_id IN (#form.unit_id_other#) </cfquery> </cfif> 






~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:328025
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to