0

我的联系表格有谷歌验证码。我必须在验证码验证后提交表格。这是我的jQuery代码。我验证正确。但我的问题是,当结果为真时,我无法提交表单。

jQuery('#citygreen-contact-us-submit').on('click',function(){
  var contact_us_form = jQuery("#contact-us-form");
     jQuerythis=jQuery(this);
        jQueryfeedback_loader=jQuery("#contact-us-loader");
        jQueryfeedback_status=jQuery("#contact-us-status");
        jQueryfeedback_loader.show();
        jQuery.ajax({
           type: "POST",
           url: ajax_url,
           dataType: 'json',
           data: "action=contact_us_validator&"+contact_us_form.serialize(),
           success  : function(result) {
              jQueryfeedback_loader.hide();
              alert(result.status);
              if(result.status == 'true') {
                 contact_us_form.submit();
              }
              else {
                 jQueryfeedback_status.addClass("error");
                 jQueryfeedback_status.html(result.message).slideDown();
                 Recaptcha.reload();
              }
           },
           error: function(testObj) {
              alert("Try Again Later");
           }
        });

     return false;
});
4

1 回答 1

0

我发现了另一个插件,比如验证码,可以使用 jquery 进行验证。我给出了克服这个问题的解决方案。

[Real Person Plugin]http://keith-wood.name/realPerson.html

jQuery函数:

function rpHash(value) { 
    var hash = 5381; 
    value = value.toUpperCase(); 
    for(var i = 0; i < value.length; i++) { 
        hash = ((hash << 5) + hash) + value.charCodeAt(i);
    } 
    return hash; 
} 
于 2013-02-01T09:43:27.220 回答