Name of button = .button_up
Name of Form = #form1
Using click function on submit button
Has basic validation (optional)
Has a forwarding page…..
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
<form name="form1" id="form1"> <script> $(document).ready(function(){ $("#sendz").click(function(){ // some validation if (document.form1.Occupation.value == "") { alert("Please add your Occupation") return false; } if (document.form1.DOB.value == "") { alert("Please add your Policy Start Date") return false; } // xxxxxxxxxxxxxxxxxxxxxxxxxxxxx form sending xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx $("#form1").click(function() { $.post("page1.php", $("#form1").serialize(), function(data) { $(".button_up").slideUp(); $("#formresponse").html(data); } ); $.post("js/page2.php", $("#form1").serialize(), function(data) { window.location="thankyou.php"; } ); return false; }); }); }); </script> |