I am trying to set a form up, so that when a check box is marked, then the corresponding date field is required. I set the script language to Javascript and entered this script:
if
(this.rawValue == "1") (PROPOSALDATE.mandatory = "error")
However, I get an error message stating "syntax error near toekn '!' on line 1, column 20." There is no ! in this script, so I don't know what it is talking about. What am I doing wrong?
Solved! Go to Solution.
Views
Replies
Total Likes
Hi,
The script that executes if the statement is true should be inside curly brackets. So the following in the click event of the checkbox should work:
if (this.rawValue == "1")
{
PROPOSALDATE.mandatory = "error";
}
else
{
PROPOSALDATE.mandatory = "disabled";
}
The above is Javascript.
Hope that helps,
Niall
Views
Replies
Total Likes
Hi,
The script that executes if the statement is true should be inside curly brackets. So the following in the click event of the checkbox should work:
if (this.rawValue == "1")
{
PROPOSALDATE.mandatory = "error";
}
else
{
PROPOSALDATE.mandatory = "disabled";
}
The above is Javascript.
Hope that helps,
Niall
Views
Replies
Total Likes
That works perfectly. Thank you very much for your help.
Views
Replies
Total Likes
Views
Likes
Replies