2

Mootoolsの検証には同様のプロセスがありますか?

SuccessFailureおよびajaxSubmitFile?

 $("#rems").validationEngine({
                    ajaxSubmit: true,
                    ajaxSubmitFile: "database/agentpanel/reminder/makerem.php",
                    success : function() { 
                        $.get("database/agentpanel/reminder/loadrem.php", function(html) {
                        $("#rem-scroll").html(html);
                        alert("Reminder Set");
                        $('#rems').find("input[type=text], textarea").val("");
                        $('#rem_confirm').attr('checked', false);
                        });
                    }, 
                    failure : function() { alert("Fill in all the fields with Red Marks"); }
                });

次のページに移動せずにフォームを送信し、スクリプトを何度も実行できるようにしたいと考えていsuccessますfailure

4

1 に答える 1

1

Mootools Form Requestにイベント関数を追加できます。

これを試して:

new Form.Request(myForm, myResult, {      
    onSend: function () {  // function to run on send
        alert('Will send now!');
    },
    onFailure: function (){//function to run if failure (fires after onComplete)
        alert('oops...!');
    },
    onComplete: function () {//function to run on send complete
        alert('Submited!');
    }, 
    onSuccess: function () {//function to run on success
        alert('Success!');
    },
    requestOptions: { //etc...

デモはこちら

読む価値:

于 2013-09-04T07:26:30.190 に答える