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

Make radio button affect tab order

New Here ,
May 01, 2020 May 01, 2020

If a user clicks on the "Yes" radio button they should jump to one field.  If they click on the "No" button they should jump to another field.  How can I do this?  Thanks.

TOPICS
How to , PDF forms
801
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 01, 2020 May 01, 2020

Select all radiobuttons, go to Properties : Actions : Mouse up : Run a JavaScript

and paste this script after editing target fields names

 

if (event.target.value != "Off") {
if (event.target.value == "Yes") {this.getField("FIELD1").setFocus();}
else if (event.target.value == "No") {this.getField("FIELD2").setFocus();}
}


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 Expert ,
May 01, 2020 May 01, 2020

You can remove the first condition and it will still work exactly the same.

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 ,
May 11, 2020 May 11, 2020

You mean

 

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

 

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 11, 2020 May 11, 2020

Yes Try67 is right, this line is useless for radio-buttons, but since it's useful for checkboxes and since I mostly use checkboxes I gave you the script as is. 😉

Don't forget to also remove the 2 associated curly braces.


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
New Here ,
May 12, 2020 May 12, 2020

OK, thanks.  I know nothing about Java, but I'll see if I can make it work.

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 12, 2020 May 12, 2020

First thing to learn is that Java and JavaScript are not the same thing, and that the latter is what is used for scripting in Acrobat...

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 ,
Jul 19, 2023 Jul 19, 2023
LATEST

Wondering how to use this if I have more than two options? Tried quite a few different ways but it either ignores the second get or automatically selects the next button I move to with the arrow key. Thank you!

 

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