Skip to main content
Alliosaaa
Inspiring
August 1, 2017
Answered

Detect Changes to Radio Button Fields?

  • August 1, 2017
  • 1 reply
  • 525 views

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!

This topic has been closed for replies.
Correct answer try67

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.

1 reply

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
August 1, 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.

Alliosaaa
AlliosaaaAuthor
Inspiring
August 1, 2017

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!