Results 1 to 2 of 2

Thread: Making Div Button work like submit button

  1. #1
    Join Date
    Mar 2008
    Posts
    15
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Question Making Div Button work like submit button

    [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.

  2. #2
    Join Date
    Jul 2006
    Location
    just north of Boston, MA
    Posts
    1,806
    Thanks
    13
    Thanked 72 Times in 72 Posts

    Default

    Code:
    <a href="" onclick="func">LINK</a>

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •