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

Detect Changes to Radio Button Fields?

Explorer ,
Aug 01, 2017 Aug 01, 2017

I am working on a rather large form for my company. Here's the general gist:

  • User selects from 4 different radio buttons groups on page 1
  • User hits "COMMIT ANSWERS" button which calls a function to spawn different pages dependent upon their answers
    • If user ignores Commit button, an app alert prompts them when the pages closes.

Currently, if someone changes any of the answers, hitting the Commit button again will update the package correctly. If we lived in a perfect world this would sufficient, however as the typical user will ignore that button... I would like an app alert to prompt them to commit their answers again when they change an answer (or change an answer and then navigate away from page 1).

Any help would be greatly appreciated!! Thank you!

TOPICS
Acrobat SDK and JavaScript
470
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

correct answers 1 Correct answer

Community Expert , Aug 01, 2017 Aug 01, 2017

You can do it using a hidden "control" field. Add a script to the MouseUp event of the radio-buttons that sets the field's value (for example, if it's a check-box, set it to be ticked), and then add a script to the "commit" button to reset it back to its default value.

Then you add a script to the Page Close event to check the value of this field. If it's ticked, you show the warning message.

Translate
Community Expert ,
Aug 01, 2017 Aug 01, 2017

You can do it using a hidden "control" field. Add a script to the MouseUp event of the radio-buttons that sets the field's value (for example, if it's a check-box, set it to be ticked), and then add a script to the "commit" button to reset it back to its default value.

Then you add a script to the Page Close event to check the value of this field. If it's ticked, you show the warning message.

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 ,
Aug 01, 2017 Aug 01, 2017
LATEST

You, my friend, are brilliant! It's amazing how the answer can be so simple, but so hard to get to. I'm very new to javascript but really love how abstractly it makes you think.

Thanks a million!

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