I have two HTML forms that submit to a PHP script. Both of the forms code are almost identical, but for some reason one of the form submit buttons require you ACTUALLY click the submit button where as the other form you can just hit enter.
If I add another field to the form that does not work, the form suddenly works. Basically the problem is I can not submit just one field. Does this make sense?
This is a browser/HTML feature. If you are in a text form field and hit the enter key, it should submit. Same when you tab to the submit button and hit enter. Have you tested your issue in different browsers and under different circumstances.
I have tried it many different ways and what I found was that if I have one text field and try to hit the enter key it does not work, but if i have two text fields and hit the enter key it works. Clicking the submit button always works, its when I try to hit enter it only works with two text inputs.
I know it is a really funny error and I have only encountered it once ever (on this project) and it only seems to be when I am only submitting one text field, if i submit two text fields everything works fine. I even thought it may be my HTML and CSS code, but when I remove all of my HTML and CSS code from the form it still does not work.
That sucks. It is very agervating for the people at this company who over ride 300 cases a day and have to enter the number and click the button when they cna easily just hit submit (the way it should work).
The problem isn't that the form doesnt submit, it just doesnt send the submit button value. So if you add <input type="hidden" name="submit" value="true"> and test for $_POST['submit'] it will work.
Chances are your two different forms are testing different values - the one that's not working is testing the submit name button, the one that is, is testing a different input