• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Text box to populate text field working, but doesn't disappear if you uncheck box.

Community Beginner ,
Nov 11, 2022 Nov 11, 2022

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. 

TOPICS
JavaScript , PDF forms

Views

264

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 11, 2022 Nov 11, 2022

Copy link to clipboard

Copied

Where does you use the script?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 15, 2022 Nov 15, 2022

Copy link to clipboard

Copied

LATEST

++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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines