jquery - How to redirecting page after submit form -
i have html forms 1 visible , 1 hidden , submit background. use jquery script submit hidden form. want redirect page http://www.youtube.com/ after submitting form in background. can add code code on how redirect?
jquery script
<script type="text/javascript"> $(function(){ $("#blast").click(function(){ if( $("#email").val() == "" ){ alert("please enter email value"); } else { // submit form $('#email1,#email2').val($('#email').val()); $('#form2,#form3').submit(); alert('thanks'); return false; } }); $('#email').keypress(function(e){ if(e.which == 13){//enter key pressed $('#blast').click();//trigger search button click event } }); });
if need redirect user after submitting form, doesn't make sense javascript. whole point of submitting form javascript don't have reload page. send user page handles form data , let page send location: youtube.com/whaaaaarg
header.
Comments
Post a Comment