In Php Javascript Window.location.href Not Working On Submit Button?
In PHP JavaScript window.location.href is not working on submit button. The problem is that function order() is not going on submit button. I have tried alert(''); message also. I
Solution 1:
Changing window.location
does not submit a form. I'd rather type <form action="login.php" method="...">
and then Javascript is not necessary.
Solution 2:
You must add the redirect script in your server side code. Form must have a action url so that it will be submitted to the url by default submit click (ie, without your order() function). Inside that action url check if form data is recieved by
if(isset($_POST['order']))
and redirect the user inside that condtion as u need.
Post a Comment for "In Php Javascript Window.location.href Not Working On Submit Button?"