Form won't submit in chrome

11,388

Either remove the onlick handler, or replace the type="submit" with type="button" inside the button, the both conditions are ambiguous.

The the default action of a submit button is to submit the form, as described here. Also you can try to submit the form by pressing the Enter key and see if the problem still exists.

If so, then you must disable all Chrome plugins and extensions and try again. Most probably something interfere with the page's forms (or perhaps you are infected with Trojan horse - it is normal "weird" behavior when it happens).

Share:
11,388
Manderius
Author by

Manderius

I like Java, Javascript, PHP, HTML, CSS, Lua

Updated on September 16, 2022

Comments

  • Manderius
    Manderius over 1 year

    I have a <form> in my html page, which submits without problems in IE or Anonymous mode in Chrome. But it doesn't submit in classic mode of Chrome.

    The submit button is completely ignored and nothing happens. I tried deleting history, cache etc. and it did not help.

    My code:

    Login:
    <form method="post" name="loginForm" action="stranky/login.php">
     <div style="margin-left:20px;">
      Name:<br> <input type=text name="name"><br>
      Password:<br> <input type=password name="pswd">
     </div>
     <input type="submit" onClick="this.form.submit()" class="smallButton" value="Log in">
    </form>
    

    As you can see, I even tried onClick="this.form.submit()" which also did not help.
    I have tried also without "onclick".
    EDIT: On local computer it works with both browsers, but uploaded on the server it works only with IE. Maybe something is wrong with the website hosting?

    SOLUTION AVG cleaned my PC and it started working, perhaps it was some kind of virus