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

How to make textbox clear when i select radio button

Community Beginner ,
May 20, 2023 May 20, 2023

Hi.

 

I want the text box to clear when I select a radio button (I don't want the radio button selected and still have text in the text box) but I don't know how to go about it. Please i need help regarding that. Thanks

TOPICS
How to
2.6K
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
1 ACCEPTED SOLUTION
Explorer ,
May 23, 2023 May 23, 2023

Try this Script:

var oFld = this.getField("text1");
if (event.target.value !== "Off") {
oFld.value = oFld.defaultValue;
oFld.readonly = true;
} else {
oFld.readonly = false;
}

View solution in original post

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 ,
May 20, 2023 May 20, 2023

Try this script in a mouse up action in the checkboxes.

You must adjust the text field name for each row.

 

var oFld = this.getField("text1");
if (event.target.value != "Off") {
oFld.value = oFld.defaultValue;
oFld.readonly = true;
}
else {oFld.readonly = false;)

 


Acrobate du PDF, InDesigner et Photoshoptographe
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 Beginner ,
May 20, 2023 May 20, 2023

Thank you very much, I'll try it. The next row would have text2 right?

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 ,
May 20, 2023 May 20, 2023

I don't know how your fields are named.

In the script you must indicate the name of the corresponding text field for each checkbox of each row.


Acrobate du PDF, InDesigner et Photoshoptographe
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 Beginner ,
May 21, 2023 May 21, 2023

Yeah, i just have time to try it...been busy but it didn't work when i tried it, it worked for only the first text box but it keeps giving me syntax error when i try to format the other text boxes. I got stuck at that point. Please do you have any idea what i should do?

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 ,
May 22, 2023 May 22, 2023

Can you share (part of) this form?


Acrobate du PDF, InDesigner et Photoshoptographe
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 Beginner ,
May 23, 2023 May 23, 2023

Sure. That's the error message that keeps showing up

EF3C10C2-1756-4AC9-9E41-F81FBB270FF6.jpeg

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
Explorer ,
May 23, 2023 May 23, 2023

Try this Script:

var oFld = this.getField("text1");
if (event.target.value !== "Off") {
oFld.value = oFld.defaultValue;
oFld.readonly = true;
} else {
oFld.readonly = false;
}
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 Beginner ,
May 23, 2023 May 23, 2023

Okay I'll try it

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 Beginner ,
May 23, 2023 May 23, 2023

It worked!!!!!!!!! Thank you so much!!!

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
Explorer ,
May 24, 2023 May 24, 2023

Great - Please mark my answer as correct.

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 Beginner ,
May 25, 2023 May 25, 2023

of course! I'll do that immediately. Thank you once again 

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 ,
May 25, 2023 May 25, 2023

Sorry, I didn't see the parenthesis at the end of my script:

 

var oFld = this.getField("text1");
if (event.target.value != "Off") {
oFld.value = oFld.defaultValue;
oFld.readonly = true;
}
else {oFld.readonly = false;}

 

😉


Acrobate du PDF, InDesigner et Photoshoptographe
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 Beginner ,
May 25, 2023 May 25, 2023
LATEST

Thank you very much, your contribution was very helpful🙏🏾

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