Hi guys, Iım using the CFFORM tag and wanted to add some extra validation.
My tag is like so: <cfform action = "/?kissMyDate=yes" format = "Flash" skin = "haloBlue" width = "400" height="420" name="Part1" onsubmit="if( password.text != '#GetUser.password#' ) { alert('Password is incorrect'); return false;}²> I added the password validation and that worked no problem, but now Iıd like to make sure that a user always makes a selection from a combo box and NOT choose the value which is ³² (<option value="">-------------------</option>). <cfselect name="numberOfReplies" label="Max emails to receive:" size="1"> <option value="<cfoutput>#GetAdvert.numberOfReplies#</cfoutput>" selected>Currently: <cfoutput>#GetAdvert.numberOfReplies#</cfoutput></option> <option value="">-------------------</option> <option value="5">5</option> <option value="10">10</option> <option value="25">25</option> <option value="10000">Unlimited</option> <option value="0">No more, I've had enough!</option> </cfselect> As it stands if the user chooses <option value="">-------------------</option> the form doesnıt have an error pop up. I thought of either doing some javascript in the cfselect or possibly adding something to the <cfform> tag similar to the onsubmit. <cfform action = "/?kissMyDate=yes" format = "Flash" skin = "haloBlue" width = "400" height="420" name="Part1" onsubmit="if( password.text != '#GetUser.password#' ) { alert('Password is incorrect'); return false;} onsubmit="if( numberOfReplies.text != '' ) { alert('Please choose max emails to receive'); return false;}²> Unfortunately the above comes up with an error. If anyone could help it would be greatly appreciated. Thanks, Saturday ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:207591 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