• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2865
  • Last Modified:

onClick submit for a form not working in Firefox

I know forms of this has been asked tons of times, but I can't seem to make out the fix.  can someone tell me the correction I need to make to my code so that this form will submit in Firefox?  Works fine in IE.  Thsi is a form that uses an image for the submit button.  The form works fine in IE, and it works if you hit "ENTER" in Firefox, but the image button will not fire the submit action....please help.  here is the code...
<table border="0" cellspacing="0" cellpadding="4">
<form name="sform" method="post" action="_search.php">
<tr> 
<td align="center">
<NOBR><span style="font-weight: bold; font-family: Arial, Helvetica, sans-serif">ZIP CODE SEARCH</span></NOBR>
</td>
<td><input name="zipcode" type="text" size="20"></td>	
<td><img border="0" src="images/go.gif" width="30" height="25" style="cursor:pointer" onClick="submit(this.form);">
</td>
</tr>
</form>
</table>

Open in new window

0
hbogie
Asked:
hbogie
  • 2
1 Solution
 
aherpsCommented:
Hi hbogie.

This solution deals with this problem you're having:

http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_21967671.html
0
 
aherpsCommented:
Just to surmise:

Courtesy of zvonko

"onClick="javascript:document.forms[0].submit();return false"

Alternatively, to specify by form name:

Three syntax methods:

onClick="javascript:document.forms['yourFormName'].submit();return false"

Or:

onClick="javascript:document.forms.yourFormName.submit();return false"


Or:

onClick="javascript:document.yourFormName.submit();return false"
0
 
hbogieAuthor Commented:
THANKS...have been looking all afternoon and got so many variations....your quick answer worked perfectly!
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now