Try the following for your two select fields:
if(document.form.sel1.value == 1){
missinginfo += "\n - Please select option for Sel1";
}
if(document.form.sel2.value == 1){
missinginfo += "\n - Please select option for Sel2";
}
Be sure and set up both Selects as follows for this to work:
<select name="sel1">
<option value="1" SELECTED>Choose option for this select</option>
<option value="2">Option2 Sel 2</option>
</select>
<select name="sel2">
<option value="1" SELECTED>Choose option for this select</option>
<option value="2">Option 2 Sel2</option>
</select>
I do not know what you are asking as far as your CFFILE question though.
Larry Juncker
Senior Cold Fusion Developer
Heartland Communications Group, Inc.
[EMAIL PROTECTED]
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 16, 2001 2:34 AM
To: CF-Talk
Subject: Javascript Validation & Coldfusion ?
Hi
How do you add validation to drop down form select boxes using Javascript. I
have added validation (shown below in the js) for the two text input fields
but need to build in validation for the two select boxes and also a CFFile
field as these are required fields in the form, any ideas on how to
integrate this into what I have below?
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function checkFields() {
missinginfo = "";
if (document.form.filename.value == "") {
missinginfo += "\n - Title of the File Uploaded";
}
if (document.form.filesummary.value == "") {
missinginfo += "\n - Descriptive Summary of Uploaded File";
}
if (missinginfo != "") {
missinginfo ="
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists