Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Submit button doesn't work

Tags:

I have a form with <input type="submit". In chrome submit doesn't do anything. On a "network" in tab in developer tools I see nothing. No errors in developer tools either. Meanwhile, if I do save a page and open a saved page, then after I press submit button, I see something appears in "network" tab. This happens in chrome and firefox. This works as expected in IE.

Does anybody have a hindsight, what should I look at?

EDIT: I don't need a direct answer, I only need to know, where should I look at. If someone posts a direction and that'll help me to solve my problem, I'll accept it as a correct answer.

EDIT2: Structure of a page looks like this:

html     head     body         div         div             form             form             form             form             form                 input                 input                 table                 table                     tbody                         tr..td..input type=submit 

EDIT3: We found the actual problem, it was that in a page was a link, containing href="#" and after clicking on that link submit stopped to work, because # was added to the end of URL and because action of the form was empty so it picked up URI from current URI, which contained # at the, so instead of submitting, browser did jump on a current page.

like image 714
dhblah Avatar asked Apr 17 '13 05:04

dhblah


2 Answers

If you are not using any JavaScript for form validation then a simple layout for your form would look like this:

<form action="formHandler.php" method="post">      <input name="fname" id="fname" type="text" value="example" />      <input type="submit" value="submit" /> </form> 

You need to ensure you have the submit button within the form element and an appropriate action attribute on the form element is present.

For a more direct answer, provide the code you are working with.

You may find the following of use: http://www.w3.org/TR/html401/interact/forms.html

like image 66
lukeocom Avatar answered Jan 03 '23 00:01

lukeocom


Are you using HTML5? If so, check whether you have any <input type="hidden"> in your form with the property required. Remove that required property. Internet Explorer won't take this property, so it works but Chrome will.

like image 31
Jyothu Avatar answered Jan 03 '23 01:01

Jyothu