0

i been trying this for hours, not sure why the .submit() just not responding.

trying with different version jquery but the same...

anyone have idea what's wrong with below?

<script src="https://code.jquery.com/jquery-1.9.1.min.js"></script>

    <script type="text/javascript">     

    $(document).ready(function() {  

        $("#btn1").click(function(e){

            e.preventDefault();         
            alert('after prevent');

            $("#myForm").submit();                                                                                                          

        }); 

        $("#myForm").on("submit", function(){
            alert('on submit');
        });         

        $(document).bind("contextmenu",function(e){
            return false;
        });             

    });

    </script>

</head>

<body>

    <form id="myForm" name="myForm" action="https://google.com" method="post">

        <input class=' form-control' id="inputFirst" size='4' type='text' placeholder="First Name" data-error="First Name is required" name="fields_fname" Required>
        <input class=' form-control' id="inputLast" size='4' type='text' placeholder="Last Name" data-error="Last Name is required" name="fields_lname" Required>
        <input type="tel" class='form-control' id="inputPhone" size='4'  placeholder="Phone" maxlength="10"  name="fields_phone" data-fphonelen="00" 
        data-fphonefirst="00" Required>
        <input type="email" class="form-control" id="inputEmail" placeholder="Email" data-error="Email is required" name="fields_email" required>                             
        <input name="submit" type="button" class="submit" value="Tap to Qualify" id="btn1">

    </form>

</body>
i need help
  • 2,386
  • 10
  • 54
  • 72

0 Answers0