I am trying to java script a yes/no set of radio buttons so that if someone marks the yes button a nearby numeric field becomes mandatory. The script I'm using seemed to work but once the person marks the yes button one time, even if they go back and change their answer to no it keeps giving them the mandatory field error message. Does anyone know what my script is missing? Here it is
if(this.rawValue =='2')
{
comappNUM1.mandatory = "error";
comappFC1.mandatory = "error";
}
else{
}
Views
Replies
Total Likes
you need to put an else result in:
else {
comappFC1.manadatory = "disabled";
comappNUM1.mandatory = "disabled";
}
Views
Replies
Total Likes
That didn't seem to work. It is still giving me the error message if I click the "yes" button one time, even if I go back and change my answer to "no". If I originally click the "no" button, it will let me proceed. But if I click "yes" it gives me an error (which I want), but the problem is that it wont let you change your anawer back to "No". It is as if once the command is activated it doesnt recognize if you unclick the "yes" button. Does that make sense? Here is the new script I entered with your recommended changes..
if(this.rawValue =='2')
{
comappNUM1.mandatory = "error";
comappFC1.mandatory = "error";
}
else{ comappFC1.manadatory = "disabled";
comappNUM1.mandatory = "disabled";
}
Views
Replies
Total Likes