1

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コード
で、サーブレットでrequest.getParameter("requir")はnullになっています。
ネット上でJquery検証エンジンについて多くを見つけることができなかったので、上記の問題に関する回答を投稿してください. フォームのテキスト ボックスの値
を取得するのを手伝ってください。 事前にサンクス。requestParameter("requir")

4

0 に答える 0