I have this script on the change event of a text field:
if ((this.rawValue != "null") || (this.rawValue != ""))
{
checkBoxThree.presence = "visible";
}
else
{
checkboxThree.presence = "hidden";
}
It is correctly displaying the checkBoxThree subform when data is entered in the text field.
However, if the user goes back and deletes the text, I would like the subform to become hidden and it isn't. How should I change the script to accomplish this?
Thanks,
MDawn
Solved! Go to Solution.
Views
Replies
Total Likes
Hi,
try this script:
checkBoxThree.presence = xfa.event.fullText.length == 0 ? "visible" : "hidden";
Views
Replies
Total Likes
Hi,
Change your if statement as follows it would work..
if (this.rawValue != null)
checkBoxThree.presence = "visible";
}
else
{
checkboxThree.presence = "hidden";
}
Please place the code on the Exit event of the textfield then it will work.
Vjay
Views
Replies
Total Likes
I tried the changes you suggested and also noticed I had checkBoxThree mis-capitalized in the 'else' statement. I fixed all that and it still doesn't hide the subform if the user deletes the content from the text field.
Thanks,
MDawn
Views
Replies
Total Likes
Hi,
try this script:
checkBoxThree.presence = xfa.event.fullText.length == 0 ? "visible" : "hidden";
Views
Replies
Total Likes
It works. Thank you.
MDawn
Views
Replies
Total Likes
Hello,
This script works perfectly and I was able to incorporate it into my form. Now the business owners want me to keep the user from submitting the form if the checkbox is visible and unchecked.
I can get the checkbox to be mandatory when visible, but am having trouble getting the checkbox to be non required when hidden.
Thanks,
MDawn
Views
Replies
Total Likes