Can I reset a form with PHP?
<p>is possible to use php to reset a form without refresh?
how can i archive this?</p>

<p>or is possible to do it with js?</p>

<p>most important is do it without to refresh the page and dont add another button for this(that's because the design)</p>

<p>any idea?
thanks
am working with recaptcha on my form and once i submitted the information i want to send a message
this is my js code</p>

<pre><code>function validateCaptcha(){
    challengeField = $("input#recaptcha_challenge_field").val();
    responseField = $("input#recaptcha_response_field").val();
    nameField = $("input#name").val();
    emailField = $("input#email").val();
    phoneField =$("input#phone").val();
    reasonField =$("select#reason").val();
    messageField =$("textarea#message").val();
    var html = $.ajax({
    type: "POST",
    url: "ajax.recaptcha.php",
    data: "recaptcha_challenge_field=" + challengeField + "&amp;recaptcha_response_field=" + responseField +"&amp;name="+ nameField +"&amp;email=" + emailField +"&amp;phone="+ phoneField + "&amp;reason=" + reasonField +"&amp;message=" + messageField,
    async: false
    }).responseText;

    if(html == "success")
    {
        $("#captchaStatus").html("Success. Submitting form.");
        $("#thanks").html("Thank you, we going to keep in touch with you soon.  ");
        return false;

    }


    else
    {
        $("#captchaStatus").html("Your captcha is incorrect. Please try again");
        Recaptcha.reload();
        return false;
    }
}
</code></pre>

<p>this is my php code</p>

<pre><code>    $name = $_POST['name'];
    $email = $_POST['email'];
    $phone = $_POST['phone'];
    $reason = $_POST['reason'];
    $message = $_POST['message'] ;

    if (empty($name)|| empty($email) || empty($message))
    {

    }
    else
    {
        $resp = recaptcha_check_answer (PRIVATEKEY, $_SERVER["REMOTE_ADDR"], $_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]);
        if ($resp-&gt;is_valid) {

            $header = 'From: ' . $email . " \r\n";
            $msg = "Sent from: " . $name . "\r\n";
            $msg .= "Email: " . $email . " \r\n";
            $msg .= "Phone: " . $phone . " \r\n";
            $msg .= "Contact reason:" . $reason . " \r\n";
            $msg .= "Message: " . $message . " \r\n";

            $to = 'patricia@anetdesign.com';
            $subject = 'Emailmakers contact page';

            mail($to, $subject, utf8_decode($msg), $header);

             ?&gt;success&lt;?


        }
        else 
        {
        die ("The reCAPTCHA wasn't entered correctly. Go back and try it again." .
           "(reCAPTCHA said: " . $resp-&gt;error . ")");

}
}
</code></pre>
