ludachris
Newbie
Posts: 1
Registered: 4/6/2005
Location: houston
Member Is Offline
|
| posted on 4/6/2005 at 06:31 PM |
|
|
Form Validation Dependency?!? HELP!!
Goal: Have a form that users can fill out and based on a previous selections, certain fields will be validated.
Problem: I cant do it!
What would be the best way for one to go about doing this? I am definitely not the smartest with javascript. I tried using an if statement for
a_fields but the script pulls that info right when the page loads. Is there a way to modify the a_fields based on radio button selection?
I tried using onSubmit="javascript:Which();" instead of v.exec() and I made the function
function Which() {
if (document.registration.booth_design.value == "tictactoe") {
return x.exec();
}
else {
return v.exec();
}
}
and
var x = new validator('registration', b_fields, o_config);
With b_fields having less fields than a_fields. The page seems to work, if I check the button that inputs tictactoe it only prompts me to change the
fields in b_fields. And if I dont choose the button that inputs tictactoe it prompts me to change the fields in a_fields. BUT after I hit OK, rather
than highlighting the fields to change it tries to continue with the form action rather than allowing me to change the data in the fields.
Let me know if any of this does not make sense. Thanks a bunch in advance to anyone who might be able to help!!
|
|
|
Seitz333
Newbie
Posts: 1
Registered: 6/12/2006
Member Is Offline
|
| posted on 6/12/2006 at 02:08 PM |
|
|
I too would like to be able to do this.
I want to turn on/off validation for a field based on the users selection of a different field.
1. If User selects 'NO' for Question #1, then validation for Question #2 is false.
2. If User selects 'YES' for Question #1, then validation for Question #2 is true.
Thanks
|
|
|
chandero
Newbie
Posts: 1
Registered: 7/20/2006
Location: Dover Delaware
Member Is Offline
|
| posted on 7/20/2006 at 07:56 PM |
|
|
I would also like to be able to designate a field as being validated if some other field has a value.
Our form uses multipe rows which are hidden until a user needs another row.
When they do they make a selection in the first field and then the other fields in that row need to be validated. If the row does not have a selection
in the first field then all fields in that row are ignored, even if they have data in them.
Please provide this functionality to a very nicely done product.
Thank you
Bob Blaney
|
|
|
tigra
Administrator
Posts: 1960
Registered: 6/17/2002
Location: US, CO
Member Is Offline
|
| posted on 7/21/2006 at 11:53 AM |
|
|
in PRO version of the script you can feed the name of the function to the field's format property. The validator will call that function and check
for the result. If false is returned then validator will report the format error. You can use this feature to attach custom function which makes all
the dependency checks firs and then validate the data if needed.
http://www.softcomplex.com/products/tigra_form_validator_pro/docs/#field_format (third option)
With free version you'll have to modify the script's code to implement dependency checks.
|
|
|