I am trying to enter a Java Script for a set of yes/no radio buttons, where if you enter yes it will require you to enter text in a nearby numeric field. The script i'm using seems to work, but once the user enters yes just one time, it will not let them change their answer back to no without getting the error message saying that they need to enter text in the other field. Can anyone help me with what I'm doign wrong? Here is the script I'm using.
'2' is the value for yes and comappNUM1 and commappFC1 are the field names I want to be required if yes is chosen. I'm guessing something needs to tell it to disable if no is selected.
if(this.rawValue =='2')
{
comappNUM1.mandatory = "error";
comappFC1.mandatory = "error";
}
else{
}
Solved! Go to Solution.
Views
Replies
Total Likes
You have to use the script in the Change-Event from the RadioButtonList!
The ' ' is wrong.
//if (this.rawValue == "2") you can also use "2"
if (this.rawValue == 2)
{
comappNUM1.mandatory = "error";
comappFC1.mandatory = "error";
}else
{
comappNUM1.mandatory = "disabled";
comappFC1.mandatory = "disabled";
}
I hope this is helpfull,
Mandy
Views
Replies
Total Likes
You have to use the script in the Change-Event from the RadioButtonList!
The ' ' is wrong.
//if (this.rawValue == "2") you can also use "2"
if (this.rawValue == 2)
{
comappNUM1.mandatory = "error";
comappFC1.mandatory = "error";
}else
{
comappNUM1.mandatory = "disabled";
comappFC1.mandatory = "disabled";
}
I hope this is helpfull,
Mandy
Views
Replies
Total Likes
That seems to work. Thank you very much!
Views
Replies
Total Likes
You're welcome!
Views
Replies
Total Likes
Views
Likes
Replies