Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

Trouble disabling a mandatory checkbox.

Avatar

Level 7

I have a text box that if the user types in text will make a checkbox required. All this is working fine now.

However, if the user goes back and 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. Can I prevent the message box and take off the red outline if the text box has been cleared?

Here is the script on the exit event of the text box:

if ((this.rawValue != "null") || (this.rawValue != ""))
{
     threeWM.mandatory = "error";
     app.alert("Please indicate that you have reviewed the similar profile and approve it");    
 
}

else
{
     threeWM.mandatory = "disabled";
}

Thanks,

MDawn

1 Accepted Solution

Avatar

Correct answer by
Level 10

Not sure why it works this way and not the other but use this:

if (!this.isNull)

View solution in original post

4 Replies

Avatar

Correct answer by
Level 10

Not sure why it works this way and not the other but use this:

if (!this.isNull)

Avatar

Level 5

Below script would work

if (this.rawValue != null)
{
     threeWM.mandatory = "error";
     app.alert("Please indicate that you have reviewed the similar profile and approve it");    
 
}

else
{
     threeWM.mandatory = "disabled";

}

Thanks

Vjay

Avatar

Level 10

Good catch Vijay, I missed that the null had quotation marks around it.

Avatar

Level 7

Thanks to all who helped. It's working correctly now.

MDawn