Aghhhhhhhhhhh, more typos, check against "" not 0 :OS Bed time :O)
Ade -----Original Message----- From: Adrian Lynch [mailto:[EMAIL PROTECTED] Sent: 14 January 2005 02:16 To: CF-Talk Subject: RE: Javascript two selects....how to force the first select FIRST Do a check on the selected index of the first select in your submitForm() function. function submitForm() { if ( document.form1.prodsize[document.form1.prodsize.selectedIndex].value != 0 ) document.form1.submit(); else alert("Would ya pick a size already!"); } Or something like that :O) Ade -----Original Message----- From: Will Tomlinson [mailto:[EMAIL PROTECTED] Sent: 14 January 2005 01:07 To: CF-Talk Subject: Javascript two selects....how to force the first select FIRST Yeah, this is Will quetion day. heehee.... I'll try to make this short and to the point. I have two selects, available sizes and available colors. I'm submitting the form via onchange in the second select- colors. My question is: How can I FORCE them to select the first one before selecting the second that submits it? Thanks, Will <InvalidTag language="JavaScript"> <!-- function submitForm() { document.form1.submit(); } //--> </script> <form action="buy.cfm" method="post" name="form1" target="loadcontent"> <p><span style="color: #FFFFFF">Select a size:</span> <select name="prodsize"> <option value="" selected>SELECT ONE</option> <cfoutput query="getavsizes" group="sizename"> <option value="#getavsizes.sizename#">#getavsizes.sizename#</option> </cfoutput> </select> <br /> <span style="color: #FFFFFF">Select a color:</span> <select name="prodcolor" OnChange="submitForm()"> <option value="" selected>SELECT ONE</option> <cfoutput query="getavcolors"> <option value="#getavcolors.colorname#">#getavcolors.colorname#</option> </cfoutput> </select> <input name="prodcategory" type="hidden" value="<cfoutput>#Left(getprodsbymodel.prodcategory, 3)#</cfoutput>" /> <input name="prodmodel" type="hidden" value="<cfoutput>#getprodsbymodel.prodmodelcode#</cfoutput>" /> </p> </form> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Get help! RoboHelp http://www.houseoffusion.com/banners/view.cfm?bannerid=58 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:190366 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54