PDA

View Full Version : Making Div Button work like submit button



balushahi
03-20-2008, 06:52 PM
[script]
function usePage(frm,nm){
for (var i_tem = 0, coverage=frm.elements; i_tem < coverage.length; i_tem++)
if(coverage[i_tem].name==nm&&coverage[i_tem].checked)
frm.action=coverage[i_tem].value;
}
[script]

[html]
<form name="frm" id="frm" action"#" onsubmit="usePage(this, 'coverage');">
<table width="100%" border="0" cellpadding="1" cellspacing="0" class="table_rules">
<tr>
<th width="6%" height="21" nowrap="nowrap"></th>
<th width="94%">Coverage </th>
</tr>
<tr>
<td><input type="radio" name="coverage" value="client_solicitation3.htm" /></td>
<td>Single</td>
</tr>
<tr class="odd_row">
<td><input type="radio" name="coverage" value="client_solicitation3.htm" /></td>
<td>Family</td>
</tr>
<tr>
<td><input type="radio" name="coverage" value="client_solicitation3.htm" /></td>
<td>Single with Family Max (Embedded)</td>
</tr>
<tr class="odd_row">
<td><input type="radio" name="coverage" value="client_solicitation3.htm" /></td>
<td>Single Multi-Individual</td>
</tr>
<tr>
<td><input type="radio" name="coverage" value="client_solicitation4.htm" /></td>
<td>Non Embedded</td>
</tr>
</table><input type="submit" value="Go">
<div class="button_row">
<div class="button_leftside"><a href='#'>CANCEL</a></div>
<div class="button_rightside"><a href="#" onsubmit="usePage(this, 'coverage');">NEXT</a></div>
</div>

</form>
[html]

I need to make the "next" div to do what go button does. call the function that redirects to the page depending on the selected radio button.

Thanks in advance for your help.

boogyman
03-21-2008, 03:42 PM
<a href="" onclick="func">LINK</a>