I have a text field where if the user has entered a value, then the checkbox that follows must be mandatory. I have this script that works (sort of), but I'm not sure which event to use to get the results I want. I want the message and the checkbox to be mandatory only if something is typed in the field.
Here's the script:
if ((this.rawValue != "null") || (this.rawValue != ""))
{
CheckBox3.mandatory = "error";
app.alert("Please indicate that you have reviewed the similar profile and approve it");
}
else if ((this.rawValue == "null") || (this.rawValue == ""))
{
CheckBox3.mandatory = "disabled";
}
Thanks,
MDawn
Solved! Go to Solution.
Views
Replies
Total Likes
you can put your script in the exit event of text field.
Views
Replies
Total Likes
you can put your script in the exit event of text field.
Views
Replies
Total Likes
That worked. Thank you. I have another problem now. If the user deletes the information typed in the text field, the message box still displays and the checkbox is still outlined in red indicating it's required and it shouldn't be.
Thanks,
MDawn
Views
Replies
Total Likes
It shouldn't - perhaps they are still leaving spaces which would count as not being null. You could put an extra condition this.rawValue != " " or something like that.
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies