javascript - Mootools code for success, failure and submit -


does mootools validation have similar process

success, failure , 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 fields red marks"); }                 }); 

i able send form without going next page, , run script on success , on failure.

you can add event functions mootools form request.

try this:

new form.request(myform, myresult, {           onsend: function () {  // function run on send         alert('will send now!');     },     onfailure: function (){//function run if failure (fires after oncomplete)         alert('oops...!');     },     oncomplete: function () {//function run on send complete         alert('submited!');     },      onsuccess: function () {//function run on success         alert('success!');     },     requestoptions: { //etc... 

demo here

worth read:


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -