I am creating a form, and giving user three options. They can select only one, based on their selection I want to send them to different page. So if they select option 1, they goto abc.html , option 2 they goto def.html etc etc
<form id="account" action="somepage.php">
<p>Select an Option</p>
<input type="radio" name="group1" id="basic" checked="checked" />
<input type="radio" name="group1" id="trade" />
<input type="radio" name="group1" id="pro" />
<button class="s_button_1 s_main_color_bgr" type="submit"><span class="s_text">Continue</span></button>
</form>
Ok Edited to add new code, in fact our actual code.
We are on a register.php page, and are offering users three levels of registration ( they can choose only one )
So the URL is http://www.somedomain.com/register.php
<form id="account">
<div class="s_row_3 clearfix">
<p>Registration Options: choose your account type</p>
<label class="s_radio" for="basic">
<input type="radio" name="group1" id="basic" checked="checked" value="basic.php" onclick="setLocation(this)"/>
<strong>Register a Basic Account</strong> <a rel="prettyPhoto[ajax]" href="/infopops/basic.php?ajax=true&width=100%&height=100%"><span class="info"> </span></a>
</label>
<label for="trade">
<input type="radio" name="group1" id="trade" value="trade.php" onclick="setLocation(this)"/>
<strong>Register a Trade Account</strong> <a rel="prettyPhoto[ajax]" href="/infopops/trade.php?ajax=true&width=100%&height=100%"><span class="info"> </span></a>
</label></a>
</label>
<label for="pro">
<input type="radio" name="group1" id="pro" value="pro.php" onclick="setLocation(this)"/>
<strong>Register a Pro Account</strong> <a rel="prettyPhoto[ajax]" href="/infopops/pro.php?ajax=true&width=100%&height=100%"><span class="info"> </span></a>
</label></a>
</label>
<br />
<p>By creating an account you will be able to shop faster, be up to date on an order's status, and keep track of the orders you have previously made.</p>
</div>
<span class="clear border_ddd"></span>
<br />
<button class="s_button_1 s_main_color_bgr" type="submit"><span class="s_text">Continue</span></button>
</form>
Js is:
<!--form script-->
<script type="text/javascript">
function setLocation(element) {
document.forms[0].action = element.value
}
</script>
<!--//form script end-->
It’s easier with jQuery, but here’s a basic version: