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

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

OT: Need to have a javascript that selectively validates

  << Previous Post |  RSS |  Sort Oldest First |  Sort Latest First |  Subscribe to this Group Next >> 
Jim,
Dan Switzer
05/15/04 11:26 P
I setup qforms but I get this error
Jim Louis
05/18/04 03:53 P
Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Jim Louis
05/15/2004 07:55 PM

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

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Dan Switzer
05/15/2004 11:26 PM

Jim, > 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. Use qForms: http://www.pengoworks.com/qforms/ There's method called createDependencyTo() which will do exactly what you want. Here's the code you'll need: // create the qForm object oForm = new qForm("nameOfYourForm"); // set up your dependencies oForm.field1.createDependencyTo("Session1", "yes"); oForm.field2.createDependencyTo("Session1", "yes"); // enforce the dependency rules on the default values oForm.Session1.enforceDependency(); Here's the docs on the functionality: http://www.pengoworks.com/qforms/docs/extension_fields.htm#createDependencyTo - Dan

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Jim Louis
05/18/2004 03:53 PM

I setup qforms but I get this error Hello, I have qforms running on a private server, I also have two CF custom tags Running that  qforms is validating.  One is CF_ThreeSelectsRelated and the other is CF_Betterselect.  qforms runs correctly and gets all of the fields validated, then at the end it throws this error.  "A Runtime error has occured do you wish to debug? Line 379. Error Object expected.  When I hit Micorsoft's debuger has a heart attack and shuts down.  I looked though qforms.js and This is the lines in question. 378: if( result ){ 379:        // run the custom onSubmit method 380:        var x = this.onSubmit(); 381:        // if a boolean value was passed back, then update the result value 382:        if( typeof x == "boolean" ) result = x;     } This is my form line <form name="signup" onSubmit="return validateForm(this)" action="add_attendeeeb.cfm" method="post"> Is there something wrong with my submit? Jim Louis ----- Excess quoted text cut - see Original Post for more ----- Dan


<< 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