|
Mailing Lists
|
Home /
Groups /
ColdFusion Talk (CF-Talk)
OT: Need to have a javascript that selectively validates
I have a web form that I need javascript validation for ifJim Louis 05/15/04 07:55 P Jim,Dan Switzer 05/15/04 11:26 P I setup qforms but I get this errorJim Louis 05/18/04 03:53 P 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 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 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
|
May 24, 2012
|
Latest Fusion Authority Articles
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||