Actually, CFSelect is JavaScript (created at run-time). However, CFSelect
won't create the JavaScript you're needing.
Quick bit of code:
<script language="JavaScript">
function checkForm(){
if (document.formName.Organization.value != "")
{document.formName.submit();}
else
{alert ("Error! You must choose an Organization.");
return false;}
}
</script>
<form name="formName" action="cfselect2.cfm" method="post" onSubmit="return
checkForm()">
Organization:<br>
<select name="Organization">
<option value="" selected>Please Choose Organization>
<!--- other option tags go here, created by outputing your query --->
</select>
</form>
----- Original Message -----
From: "Shannon Carr" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, May 11, 2000 12:27 PM
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.