Thread: MooTools Submit stop event
View Single Post
Old 01-22-2013, 09:23 PM   PM User | #1
shile
New Coder

 
Join Date: Oct 2012
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
shile is an unknown quantity at this point
Submit stop event

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...

Code:
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();

});


});
shile is offline   Reply With Quote