5

Here I placed the table inside form to arrange the form items.
It does not work even though it is valid.

<form method="get" action="another.php">
<table width="50%" border="0" cellspacing="0" cellpadding="0">
<tr>
    <td width="60%">
        Number: <input type="text" name="number" />
    </td>
    <td width="20%" align="center">
        Title: <input type="text" name="title" />
    </td>
    <td width="20%">
        Short Desc: <input type="text" name="shortdesc" />
    </td>
</tr>
</table>
</form>

When I press Enter, the form won't submit.
where as if I place a submit button anywhere inside the form, it works for both Enter key and Button click.

<input type = "submit" value="Submit" />

But I don't want any buttons for submissions. I Submit the form by pressing Enter key.
Any clues why this doesn't work ?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Madhu Dollu
  • 434
  • 3
  • 6
  • 20

3 Answers3

4

Add this to your form

<input type="submit" style="position: absolute; left: -9999px"/>

or

<input type="submit" style="visibility: hidden;"/>
Eli
  • 14,779
  • 5
  • 59
  • 77
0

add this ....will fix your problem for all three browser

 <input  type="submit" name="update" value=" Apply " 
style="position: absolute; height: 0px; width: 0px; border: none; padding: 0px;"
hidefocus="true" tabindex="-1"/>
thumber nirmal
  • 1,639
  • 3
  • 16
  • 27
0

all forms need a submit button to be submitted (without javascript atleast):

you can make it invisible:

<input type="submit" style="visibility:hidden"/>
mn.
  • 796
  • 6
  • 12