Copy link to clipboard
Copied
Hi.
I've got the java script below which is working to populate a text field when the checkbox is ticked. However, if the user makes a mistake and unchecks the box - the text does not disappear - what can I do to fix please - I'm a beginner with Java script. This is what I'm using....
var nDisplay = event.target.isBoxChecked(76) ? display.hidden : display.visible; this.getField("tired_Eyes").display = nDisplay;
Thanks in advance for your help.
Copy link to clipboard
Copied
Where does you use the script?
Copy link to clipboard
Copied
++Adding to the topic,
Seems like you're copying and pasting a script developed by someone else for another user in this thread:
As Bernd Alheit asked, the key here is that you want to make the text field "tired_Eyes" hidden or visible based on the check status of that tickbox widget. So it is important to be aware where is the code executed from.
In my humble opinion, if you're new to Arobat JavaScript, The easiest way to do this is to run the script directly from the tick box as a Mouse Up action.
You've also mentioned about the text in the "tired_Eyes" field not cleared when the user makes a mistake or uncheck the tickbox. Hiding a field and making a field visible/hidden are two different things.
You need to modify your code a little bit so that when the user interacts with the tickbox it clears that text field, in addition to hiding or unhiding it.