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

Unselect the check mark I want it to go back to being blank. Is there code for that?

New Here ,
Sep 11, 2023 Sep 11, 2023

Hi,

 

I am creating a form for a lesson plan.  I have a field that when the checkbox is clicked it will fill the content in other text boxes. However, when unelecting the check mark it leaves the filled content. If I unselect the check mark I want it to go back to being blank. Is there code for that? 

TOPICS
PDF forms
231
Translate
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
New Here ,
Sep 11, 2023 Sep 11, 2023

The code I am currently using:

if (event.target.value!="Off")

this.getField("Text5").value=this.getField("Text3").value;

Translate
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 ,
Sep 11, 2023 Sep 11, 2023

Add this:

else this.getField("Text5").value = "";

Translate
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 ,
Sep 11, 2023 Sep 11, 2023
LATEST

Be aware that if the user changes the value of Text3 after having ticked the check-box, Text5 won't update with it, and will still show the previous value.

Translate
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