HTML/JS: Using Radio Inputs to Change a Form’s Action

Brackets LogoHave you ever wanted a selection, via radio inputs, to change the outcome of a submit button’s action?

For a simple solution, you may have come to the right place.

Amidst revisions to a web project at my job, I found myself needing to answer the above question.┬áI had to demonstrate a relatively simple user-experience┬árequirement: provide a list of radio inputs that would control the user’s destination once they hit a contextual “submit” button. Fortunately, one of our lead web developers walked me through an incredibly simple inline javascript solution. It worked on the first try, and it’s so simple that I felt compelled to share it.

Continue reading

Advertisements