jQuery change submit value to "Please wait" & then submit the form using PHP
<p>I have a form.</p>

<pre><code>            &lt;form action="login.php" method="post" id="form"&gt;
                &lt;input type="text" name="name" class="textbox" id="name" placeholder="Username"&gt;&lt;br /&gt;&lt;br /&gt;
                &lt;input type="password" name="pass" class="textbox" id="pass" placeholder="Password"&gt;&lt;br /&gt;&lt;br /&gt;
                &lt;div id="holder"&gt;
                    &lt;input type="submit" name="submit" value="Login" class="submit_wide"&gt;
                &lt;/div&gt;
                &lt;br /&gt;
            &lt;/form&gt;
</code></pre>

<p>I want to change the value of the submit input to "Please wait.." upon click. So while the page is redirecting, user will see "Please wait..".</p>

<p><strong>I don't want to POST using javascript, I want it to redirect.</strong></p>

<p><em>When I click 'Login', it changes to 'Please wait', but the submit action stops, but when I click again, it redirects.</em></p>

<p><em><strong>What's wrong and how do I fix this?</em></strong></p>

<pre><code>$(document).ready(function() {
            $(".submit_wide").click(function() 
            {
                if ($("#name").val() != '' &amp;&amp; $("#pass").val() != '')
                {
                    $("#holder").html('&lt;input type="submit" name="submit" value="Please wait.." class="submit_wide"&gt;');
                }
                else
                {
                    $("#error").fadeIn("slow");
                    $("#error").html('&lt;span class="alert alert-error"&gt;Please fill ALL of the fields.&lt;/span&gt;');
                    event.preventDefault();                 
                }
            });
        });
</code></pre>

<p><strong>What I've tried:</strong></p>

<p><em>Adding</em></p>

<pre><code>$("#form").submit();
</code></pre>

<p>after the HTML change line.</p>

<p>It' just does the same as it did before.</p>

<p>How do I fix this and what causing this?
Thanks.</p>
