Shannon,
I just had a similar issue, and I got around it like this:
<head>
<script>
function checkFields(){
field1 = document.FORMNAME.VARIABLENAME.value;
if(field1 == ""){
alert("Please enter A VALUE HERE");
return false;
}
else{
return true;
}
}
</script></head>...
...
<select name="VariableName" size="1">
<option value="0">Please Choose One
<cfoutput query="QUERY" group="GROUP-TO-BY">
<option value="#GROUP-TO-BY#">#displayvariable#
</cfoutput>
</select>...
...
<input type="submit" style="cursor:hand" value="Save Changes"
onClick="return checkFields();">
It may not be strict CF, but it worked...
If you've got any questions, then just let me know.
Gordie
Mike "Gordie" Doyle
ColdFusion Web Developer
eTour.com
-----Original Message-----
From: Shannon Carr [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 11, 2000 1:28 PM
To: [EMAIL PROTECTED]
Subject: cfselect validation
I am having trouble using cfselect to validate a select box. I would like
to display "Please Choose Organization" without a value. If form is
submitted with Organization not selected then display error.
Can this be done with cfselect or should I use java script validation?
Thanks,
Shannon
<cfform action="cfselect2.cfm" method="post">
Organization:<br>
<cfselect name="Organization"
message="Error! You must choose an Orgaqnization."
query="GetOganizationName"
value="OrganizationID"
display="OrganizationName"
required="Yes"><option value="" selected>Please Choose
Organization</cfselect>
<input type="Submit" value="Submit">
<input type="Reset" value="Reset">
</cfform>
----------------------------------------------------------------------------
--
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.
------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.