请求参数在java中的ajax jquery验证引擎中变为null

时间:2012-09-21 10:15:42

标签: jquery-validation-engine

jqueryvalidationengine-en.js

"ajaxUserCall": {
    "url": "ajaxValidateFieldUser",
    // you may want to pass extra data on the ajax call
    "extraData": "name=eric",
    "alertTextOk":"* This user name can be used and is available",
    "alertText": "* This user is already taken",
    "alertTextLoad": "* Validating..., please wait"
}

xyz.html

<input class="validate[ajax[ajaxUserCall]] text-input" type="text" name="requir" id="requir" title="Text value is required"/>

function beforeCall(form, options){
    if (console)
        console.log("Right before the AJAX form validation call");
    return true;
}
// Called once the server replies to the ajax form validation request
function ajaxValidationCallback(status, form, json, options){
    if (console)
        console.log(status);

    if (status === true) {
        alert("the form is valid!");
        // uncomment these lines to submit the form to form.action
        // form.validationEngine('detach');
        // form.submit();
        // or you may use AJAX again to submit the data
    }
}

jQuery(document).ready(function(){
    jQuery("#formID").validationEngine({
    ajaxFormValidation: true,
    onAjaxFormComplete: ajaxValidationCallback,
    onBeforeAjaxFormValidation: beforeCall
    });
});

上面是我的html和jqueryengine-en.js代码
在servlet中我得到request.getParameter("requir")为空。
请将有关上述问题的答案发给我,因为我无法在网上找到关于Jquery验证引擎的更多信息,请分享一些链接,我可以从中学习更多内容。
请帮助我使用表单文本框值获取requestParameter("requir") 提前完成。

0 个答案:

没有答案