0

我的Recaptcha代码未触发,并且在未验证 Recaptcha 代码的情况下提交了数据。

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <script src="http://code.jquery.com/jquery-1.9.1.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {

        $('#appointment').submit(function (e) {
            e.preventDefault();

            var serviceURL = 'WebService.asmx/SendMail';
            var Name = $("#fname").val();
            var Email = $("#email").val();
            var Telephone = $("#phone").val();
            var Comment = $("#comment").val();

            $.ajax({
                type: "POST",
                url: serviceURL,
                data: '{"name":"' + Name + '","address":"' + Email + '","telephone":"' + Telephone + '","comment":"' + Comment + '"}',
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: successFunc,
                error: errorFunc
            });

            function successFunc(data, status) {

                alert("sent");


            }

            function errorFunc() {
                alert('error');
            }

        });

        });

</script>
</head>
<body>
   <form name="appointment" id="appointment" method="post" action="About.aspx">
    <div>
    </div><div id="leftcolumn4"><div class="h2">Contact Form</div>
      <form name="appointment" id="Form1" method="post" onsubmit="return validate(appointment)" action="send_contact.php">
Full Name:
<br />
<label>
  <input name="fname" type="text" class="form-input" id="fname" size="30" />
</label> 
<br /><br />

Email Address:<br />
<label>
  <input name="email" type="text" class="form-input" id="email" size="30" />
</label><br /><br />
Telephone:
<br />
<label>
  <input name="phone" type="text" class="form-input" id="phone" size="30" />
</label> 
<br /><br />
Your Comment:<br />
<label>
<textarea name="comment" cols="28" rows="4" class="form-input-box" id="comment"></textarea><br />
<script type="text/javascript"
     src="http://www.google.com/recaptcha/api/challenge?k=6LetqOASAAAAAJ_ZUBYE4rEGG5qj06GhqVbg481I">
  </script>
<noscript>
     <iframe src="http://www.google.com/recaptcha/api/noscript?k=6LetqOASAAAAAJ_ZUBYE4rEGG5qj06GhqVbg481I"
         height="300" width="500" frameborder="0"></iframe><br>
     <textarea name="recaptcha_challenge_field" rows="3" cols="40">
     </textarea>
     <input type="hidden" name="recaptcha_response_field"
         value="manual_challenge">
  </noscript>
      <br />
&nbsp;</label><input name="submit" type="submit" class="form-input-submit" value="Submit" id="btnMail"/>
    </div>
    </form>
</body>
</html>
4

0 回答 0