Skip to main content
Participant
May 20, 2016
Answered

button field with two urls

I want to use a button field "Link" with 2 various links in combination with an option field "answer" (options: yes or no).

If option field "answer" is on "yes", the button "Link" links to url1, if the user clicks on option “no”, this button field links to url2, if the user did not select anything, the button field "Link" should not forward to any urls. Can this be done by javascript?

This topic is closed to new replies. Start a new post to keep the conversation going.
gkaiserilCorrect answer
Inspiring
May 20, 2016

Yes, one needs to use the "if" statement twice or a switch statement. You will first need to check to see if there has been a selection of one of the check boxes then if one of the buttons has been selected, you run the code for the appropriate selection. Using a switch statement you only need to test for the none selected, option 1, or option 2.

1 reply

gkaiserilCorrect answer
Inspiring
May 20, 2016

Yes, one needs to use the "if" statement twice or a switch statement. You will first need to check to see if there has been a selection of one of the check boxes then if one of the buttons has been selected, you run the code for the appropriate selection. Using a switch statement you only need to test for the none selected, option 1, or option 2.

Translate