Welcome Guest, Not a member yet? Register   Sign In
How to redirect on form validation succes?
#11

[eluser]kgill[/eluser]
Ok, if you're using .post() you're sending the form via an AJAX request - you can't redirect that. Redirection works like this, the browser sends a request to the server saying give me this page, the server responds with go here instead. If nothing has loaded in the browser yet the browser makes the request for that page. This is why if you accidentally echo/print/have an error before a redirect it fails.

Where you're trying to redirect, the browser has already rendered a complete page and is executing scripts on it, the server can't force the client to go somewhere else at that point. Your solution is simple, either submit the form normally or alter your JS to use a callback that sets the window location.


Messages In This Thread
How to redirect on form validation succes? - by El Forum - 01-09-2010, 12:21 PM
How to redirect on form validation succes? - by El Forum - 01-09-2010, 12:57 PM
How to redirect on form validation succes? - by El Forum - 01-09-2010, 01:10 PM
How to redirect on form validation succes? - by El Forum - 01-09-2010, 01:14 PM
How to redirect on form validation succes? - by El Forum - 01-09-2010, 01:22 PM
How to redirect on form validation succes? - by El Forum - 01-09-2010, 04:31 PM
How to redirect on form validation succes? - by El Forum - 01-09-2010, 07:59 PM
How to redirect on form validation succes? - by El Forum - 01-09-2010, 08:29 PM
How to redirect on form validation succes? - by El Forum - 01-09-2010, 08:32 PM
How to redirect on form validation succes? - by El Forum - 01-10-2010, 02:55 AM
How to redirect on form validation succes? - by El Forum - 01-10-2010, 01:24 PM
How to redirect on form validation succes? - by El Forum - 01-10-2010, 03:04 PM
How to redirect on form validation succes? - by El Forum - 01-11-2010, 05:37 AM
How to redirect on form validation succes? - by El Forum - 01-11-2010, 12:00 PM



Theme © iAndrew 2016 - Forum software by © MyBB