01-10-2010, 01:24 PM
[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.
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.