Forum Moderators: open

Message Too Old, No Replies

onsubmit with text link submit button

         

princeofvegas

5:59 pm on Jul 7, 2010 (gmt 0)

10+ Year Member



hello,

I have a form that has a text link button. There is no other way around this for this form. Basically everything works with the text link submit, however the onsubmit event for the form does not work. Is there a way to get this working?

<form action="view_print.php" onSubmit="return GB_showCenter('Testing', this.action, 900, 650)" title="View Print Coupon" name="user_address" method="get">
<table width="500" border="0">
<tr>
<td><input type="text" class="inputtext" name="searchaddress" style="width:200px;"/></td>
<td><input type="text" class="inputtext" name="searchcity" style="width:140px;"/></td>
<td><input type="text" class="inputtext" name="searchstate" style="width:50px;"/></td>
<td><input type="text" class="inputtext" name="searchzip" maxlength="5" style="width:100px;"/></td>
</tr>
<tr>
<td id="searchaddresslabel">Street Address</td>
<td id="searchaddresslabel">City &amp;</td>
<td id="searchaddresslabel">State</td>
<td id="searchaddresslabel">or Zip</td>
</tr>
</table>
<br />
<input type="hidden" id="coupon_id" name="coupon_id" />
<a href="javascript:document.getElementById('coupon_id').value='4';document.user_address.submit();">Test Link Submit</a>
</form>


Thank You in advance for any help

Fotiman

6:40 pm on Jul 7, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Text link form submit buttons are very bad. They are not accessible for users that don't have JavaScript enabled. Why do you say there is no other way around this for this form?

rainborick

7:19 pm on Jul 7, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



You can try:

document.forms['user_address'].submit();