views:

27

answers:

3

I have a form with text input + gradient-shaded button with onclick='this.form.submit()' (plus some hidden inputs).

In all browsers, clicking on the button works.

In Firefox, if I click Enter while in text input, it submits the form. In IE, it does nothing.

How can I make it work with IE?

A: 

This type of form will always work with "Enter":

<form ...>
  ...
  <input type="submit" ...>
</form>

Make sure you have an input of type submit.

Delan Azabani
+1  A: 

Create an empty text box, with a style of "visibility:hidden;display:none", this is a known issue

RandomNoob
+1  A: 

If I remember correctly IE likes having an actual submit button, whether that's an <input type="submit" /> or <button type="submit">submit me</button>. Maybe you can put that in there but "out of sight" so you don't see it..

CharlesLeaf
Thanks, adding `type='submit'` on the button solved it.
taw