> 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
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

