I have created a form in which on submitting name my url is getting redirected but i want after form action it should get redirect to my mobile validation page. after putting the code, i want it to show the offer page. I am not able to write ajax. my function is not getting called. here is what i have tried till now http://plnkr.co/edit/3DA7YGb58BgcVcD0d10f?p=preview
<!DOCTYPE html>
<html>
    <head>
        <link rel="stylesheet" href="style.css">
        <script src="script.js"></script>
    </head>
    <body>
        <form name="msform"  action="another.html" method="post" id="msform">
            <input name="name" type="text" placeholder="First Name" />
            <input class="bl" id="submitbl" type="submit" value="Submit" />
        </form>
        <script type="text/javascript">
            $("#submitbl").click(function(){
                if($("#msform").valid() === true) {
                    var name  = $('input[name|="name"]').val();
                    //use ajax to run the check
                    $.ajax({
                        type : 'POST',
                        url  : 'mobile.html',
                        success: function(responseText){
                            resp = responseText.trim().substring(14);
                            if(resp == 'qualified') {
                                url_redirect({url: "offer.html",
                                    method: "post",
                                    data: { "fname": name }
                                });
                            }
                        }
                    });
                }
            });
        </script>
    </body>
</html>
 
     
    