Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p><strong>Edit</strong>: Why it's not working Read through your script. The suggestion you added (my code) is just a regular statement in the global scope - When the browser loads the file it</p> <ol> <li>Sets the document ready method</li> <li>Realizes the function validate</li> <li><strong>Executes the set-value-to-blank</strong></li> <li>Sets the ajaxForm value</li> </ol> <p>I'm assuming you want to reset the form after it's been validated (and move on).</p> <p>In that case, you want the resetting-code to run when the form is done. When is that? Here: <code>$("#form1").ajaxForm(function(){...</code></p> <p>Someone else has actually given you the exact code (I believe) but I really think it's an issue with your understanding of computers and javascript and how languages execute. You should really do more homework and try to follow the logic of your script. Simple debugging tools such as <code>alert("I'm resetting the values now!")</code> would tell you when your code is executing (whether it's in the right place or not)</p> <hr> <p>Nowhere in your code does it actually try to clear the text. These would be some instructions to tell the browser to reset/erase the content. I'm guessing you want to clear it only when it's correct so you would add it to the <code>.ajaxForm</code> callback</p> <pre><code>var name = $('input[name=name]').val(''); //inputs are like this &lt;input value="Hi"&gt; var email = $('input[name=email]').val(''); var message = $('textarea[name=message]').html(''); //textareas are like this &lt;textarea&gt;Hi&lt;/textarea&gt; </code></pre> <p>And by the way, fadeOut only makes it "fade out", it ends up hiding the block (css display: none; I'm guessing), but doesn't change the DOM element/form.</p>
 

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