Mootools submit stop event

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
shile
Forum Newbie
Posts: 15
Joined: Thu Oct 04, 2012 6:45 pm

Mootools submit stop event

Post by shile »

well,i have this script that i have set up that on submit requests php file that is used to validate my input values...i have set up that when it is not validated the correct way to echo it is not validated,now i want in my request when i get response and it is the error response to stop the submit..here is the script,it does send the request and returns response but it doesnt stop the submit...

window.addEvent('domready', function(){
var form=document.adminForm;
form.addEvent('submit', function(e){


var dataString="date=" + document.getElementById("date").value + "&start=" + document.getElementById("start").value + "&end=" + document.getElementById("end").value;
var requestData = new Request ({
url: '/provjera.php',
method:'POST',
async:false,
evalResponse:true,
data:dataString,
onComplete: function(responseText){
alert(responseText);
if(responseText){}
e.stop();

}
});

requestData.send();

});


});
Post Reply