Note that there are some explanatory texts on larger screens.

plurals
  1. POUsing Javascript to submit forms
    primarykey
    data
    text
    <p>EDIT: For some reason if I change the input into an , the submit code works fine. Ok, this works, I'll just style the a tag to look like an input tag in css.</p> <p>I am using a jQuery function to submit a form when a certain button is pressed, however this seems to have no effect on the form.</p> <p>My code is as follows: HTML:</p> <pre><code>&lt;form id="loginForm" action="" method="POST"&gt; &lt;input class="loginInput" type="hidden" name="action" value="login"&gt; &lt;input id="step1a" class="loginInput" type="text" name="username"&gt; &lt;input id="step2a" class="loginInput" type="password" name="password" style="display:none;"&gt; &lt;input id="step1b" class="loginSubmit" onclick="loginProceed();" type="button" name="submit" value="Proceed" title="Proceed" /&gt; &lt;input id="step2b" class="loginSubmit" onclick="submitlogin();" type="button" value="Validate" title="Validate" style="display:none;" /&gt; &lt;/form&gt; </code></pre> <p>Javascript:</p> <pre><code>function submitlogin() { $("#loginForm").submit(); } function loginProceed() { $("#step1a").fadeOut("slow",function(){ $("#step2a").fadeIn("slow", function(){ $("#step2a").focus(); }); }); $("#step1b").fadeOut("slow",function(){ $("#step2b").fadeIn("slow"); }); $("#step1c").fadeOut("slow",function(){ $("#step2c").fadeIn("slow"); }); } </code></pre> <p>However, when I press the button, absolutely nothing occurs. </p> <p>PS. This function may seem meaningless since I can just use a input type="submit" but I originally intended this to have some more functionality, I stripped the function to its bare bones for testing purposes.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload