E
Enoch
Hello,
Is it possible to conditionally validate fields based on the selection
of a radio button?
ie:
//////
()go this way ()go that way
//////
then when one of them is selected a previously hidden field will show
up using onclick event
//////
Oh! you are going this way! Fill this in: _________________________
//////
or
/////
Oh! you are going that way! Fill that in: _________________________
/////
and finally when the submit button is click I want to validate
whichever field was selected exclusively.
I thought to create a global variable outside of the functions: var
myGlobalVar;
and then set it within the OnClick event function:
myGlobalVar="this_way";
and then only validate the field within another function if that var
is set:
validate_form(this form){
with (this form)
if (myGlobalVar == "this_way"){validate this field}
else if(myGlobalVar == "that_way"){validate that field}
}
it doesn't work....
if I put alert(myGlobalVar) before the with(this form) I can see the
variable
if if put it after the with(this form) i get something like
object:node in the alert box.
any ideas or suggestions would be really appreciated THANKS!!!!!
Is it possible to conditionally validate fields based on the selection
of a radio button?
ie:
//////
()go this way ()go that way
//////
then when one of them is selected a previously hidden field will show
up using onclick event
//////
Oh! you are going this way! Fill this in: _________________________
//////
or
/////
Oh! you are going that way! Fill that in: _________________________
/////
and finally when the submit button is click I want to validate
whichever field was selected exclusively.
I thought to create a global variable outside of the functions: var
myGlobalVar;
and then set it within the OnClick event function:
myGlobalVar="this_way";
and then only validate the field within another function if that var
is set:
validate_form(this form){
with (this form)
if (myGlobalVar == "this_way"){validate this field}
else if(myGlobalVar == "that_way"){validate that field}
}
it doesn't work....
if I put alert(myGlobalVar) before the with(this form) I can see the
variable
if if put it after the with(this form) i get something like
object:node in the alert box.
any ideas or suggestions would be really appreciated THANKS!!!!!