Forum Moderators: open

Message Too Old, No Replies

need javascript onsubmit help

         

iamsamurai

1:39 pm on Sep 28, 2006 (gmt 0)

10+ Year Member



I have a simple form with 3 radio buttons and a submit button. I want to have it where is say the first radio button is selected and then they hit the submit button it will take the person to one url in the same window. Or if they select the second radio button and hit submit it will take them to another url.

Can anyone help me out with how I would have to code this.

DrDoc

5:09 am on Sep 29, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



One way is to use
onchange
and/or
onclick
on the radio buttons to capture events. Then, based on which was clicked/changed, change the form
action
attribute.

Another way, which is preferrable, is to simply let the whole form submit to one page, and then you redirect the form submission from there based on which radio was selected.