It's hard for me to believe I'm the only one who has had
problems with CFFORM format="flash" cfselect validation. But hours
of searching turned up VERY LITTLE. I managed to cobble something
together, so for anyone else who has this problem, and happens
across my post, here's how I solved it:
<cfsavecontent variable="validate">
// perform client side validation here if you want
var validationError = "False";
var myString = "Please Select a value for the following:";
var alertTitle = "Data Input Required";
if (theForm.testSelect.value == 'none')
{
var validationError = "True";
var myString = myString + " Location,";
}
if (theForm.testSelect2.value == 'none')
{
var validationError = "True";
var myString = myString + " Option2,";
}
if (validationError == 'True')
{
alert(myString,alertTitle);
return false;
}
</cfsavecontent>
<cfform name="theForm" action="" format="flash"
height="220" width="450" onSubmit="#validate#">
<cfselect name="testSelect" width="100" size="1"
multiple="no" required="Yes" query="q1" display ="firstname" value
="firstname" selected="" queryPosition="Below">
<option value="none">Select One
</cfselect>
<cfselect name="testSelect2" width="100" size="1"
multiple="no" required="Yes" query="q1" display ="lastname" value
="lastname" selected="" queryPosition="Below">
<option value="none">Select One
</cfselect>
<cfinput name="Location" type="text" label="Location"
value="" width="300" required="Yes" message="Please provide a
location" />
<cfinput name="Test2" type="text" label="Test" value=""
width="300" required="Yes" message="Please provide a test" />
<cfinput type="submit" name="submitBtn" value="Send Data"
width="100">
</cfform>