dhblah dhblah - 3 months ago 10
HTML Question

Submit button doesn't work

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.

Answer

If you are not using any javascript/jquery for form validation, then a simple layout for your form would look like this.

within the body of your html document:

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

You need to ensure you have the submit button within the form tags, and an appropriate action assigned. Such as sending to a php file.

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

Comments