Jquery.Validation IE and FF issue

80 Views Asked by At

hello guys i'm having an issue with the jquery validation plugin. the code works fine in chrome and Opera while not in EI version 10.0.xx and FF version 23.xx whenever i click the button to submit the form it wont work

     <script src="style/js/jquery.js"></script>
    <script src="style/js/jquery.validate.js"></script>
<script type="text/javascript" src="style/js/jquery.form.js"></script>
      <script type="text/javascript">
      $(document).ready(function(){
            var kosh = document.getElementById("username").value;
            $("#form").validate({
                rules:{
                    full_name:"required",
                    user_name:"required",
                    secret:"required",
                    user_email:{
                            required:true,
                            email: true
                        },
                    pwd:{
                        required:true,
                        minlength: 8
                    },
                    cpwd:{
                        required:true,
                        equalTo: "#pwd"
                    },
                    gender:"required",
                    privacy:"required"
                },
                messages:{
                    full_name:"Enter your first and last name",
                    user_name:"Please Chose a Username",
                    secret:"Your Secret Word Can't Be Empty",
                    user_email:{
                        required:"Enter your email address",
                        email:"Enter valid email address"
                    },
                    pwd:{
                        required:"Enter your password",
                        minlength:"Password must be minimum 8 characters"
                    },
                    cpwd:{
                        required:"Enter confirm password",
                        equalTo:"Password and Confirm Password must match"
                    },
                    gender:"Select Gender",
                    privacy:"Select How you like to share your photos with others"
                },
                errorClass: "help-inline",
                errorElement: "span",
                highlight:function(element, errorClass, validClass) {
                    $(element).parents('.control-group').addClass('error');
                },
                unhighlight: function(element, errorClass, validClass) {
                    $(element).parents('.control-group').removeClass('error');
                    $(element).parents('.control-group').addClass('success');
                }
            });         
$('document').ready(function()
{
$('#form').ajaxForm( {
target: '#preview', 
success: function() { 
$('#formbox').slideUp('fast'); 
} 
}); 
$('#loginForm').ajaxForm( {
target: '#preview', 
success: function() { 
$('#formbox').slideUp('fast'); 
} 
});
});

        });
      </script>

and my form as follow

          <form action="func/login.php" id="loginForm" name="loginForm" method="post" class="navbar-form pull-right">

          <input required class="input-large" name="user" placeholder="Your Username..." type="text">
          <input  required type="password" name="pass"  placeholder="Your Password" class="input-large">
        <button class="btn btn-success">Login !</button>
        <a href="reset.php"><span style="color:#fff; position:relative; top:3px; align:center; font-family:verdana;padding:3px; font-size:10px">Forgot Password?</span></a>
      </form>

lets say if i typed the wrong username and password it actually returns the result but whenever the username and password are correct it doesn't get the result from the php script which if username and password are correct it automatically load the index.php but it wont load it but i already signed in, if i typed the index.php to the url bar

1

There are 1 best solutions below

0
On

fix it by replacing

echo'<meta http-equiv="refresh" content="0;URL=index.php">';

to

echo'<script>document.location.href="index.php"</script>';

which i don't know why FF and IE wont accept the meta tag