Welcome to WebmasterWorld Guest from 22.214.171.124
Forum Moderators: open
so I use ajax to validate form input, whenever user click on the "submit" button which I attached an "onclick" event to it, it calls the ajax function to the php validation script.
after everything is ok, I was able to add user's post into database, but the current page just sits there, it won't redirect user to another page, "index" page let say.
so how do I do this? I want to redirect user to some other page after let say they post a topic, but using ajax only check for onclick event. If I attached an onsubmit event, my ajax won't work anymore.
answer: so we can't redirect (using server side code) to a different page after submitted a form using ajax to validate because that's the whole point of using Ajax in the first place. We can add a window.location to ajax handler to redirect.