House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Mailing Lists
Home /  Groups /  ColdFusion Talk (CF-Talk)

Need to have a javascript that selectively validates

  << Previous Post |  RSS |  Subscribe to this Group Next >> 

Need to have a javascript that selectively validates

Jim, Whittingham, P 05/17/2004 07:07 AM

05/17/2004 07:07 AM
Author: Whittingham, P Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:32542#163330 Jim, i presume session1 is a field name within your form and you want the validation at on submit event....remember javascript is a case-sensitive language unlike CF. The Javascript Bible, by Dan Goodman is an excellent book Pat <script> <!-- function valid() { if (document.forms[0].session.value == 'yes' ) &&    (document.forms[0].field2.value != '' or document.forms[0].field3.value != '') {    alert("field 2 and field3 are required....");    return false; } return true; } </script> <form name="x" onsubmit="return valid(); " > ...... </form> I have a web form that I need javascript validation for if Session1 is "yes" then field2 and field3 are required.   If session 1 is "no" then field 2 and field3 are not required. Can someone point me in the right direction.  I want to use javascipt because the rest of the form validation is using it. Jim Louis   _____  
<< Previous Thread Today's Threads Next Thread >>

Search cf-talk

May 24, 2012

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
     1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31     

Designer, Developer and mobile workflow conference