Welcome Guest, Not a member yet? Register   Sign In
Need form submit help
#1

[eluser]nandish[/eluser]
trying to validate before form submit, its validating and giving alert message ,its not stoping form submit at all

Thanks

Code:
function validateLogin() {
if (!Checkvaliduser())
{
    return false;
}
}

//--------------------------------------------------------
function Checkvaliduser(){
    var userID = $("#userid").val();
    var passwordvalue = $("#password").val();
   if($.trim(userID)!= "" && $.trim(passwordvalue)!= ""){
                var checkUser=true;

       $.get("/index.php/clogon/verifyLogin/" + userID + "/" + passwordvalue,function(data) {
                   if(data.toString() == "0") {
                       checkUser = false;
                }
       });

            if(!checkUser) {  
                 alert("Invalid User ID and Password");
                      $("#userid").focus();
                       return false;
            }
return checkUser;
}
}

Edited by Michael Wales: Removed the coloring, added code tags.


Messages In This Thread
Need form submit help - by El Forum - 05-08-2009, 07:32 AM
Need form submit help - by El Forum - 05-08-2009, 08:14 AM



Theme © iAndrew 2016 - Forum software by © MyBB