I’m working on a website where the user fills out a form and submits it with a button that sends a POST. I would like the user to submit the POST and be redirected in the same action. Currently I have a javascript redirect (with window.location) implemented but I wish the page was condensed better. Is there an easy way for the same element to send a POST and subsequently send a GET to a different address? If it wasn’t obvious I’m new to web development so apologies if my terminology is incorrect.
I’m working on a website where the user fills out a form and submits
Share
Just set the
actionattribute of the form to the URL you want to process the form.You can’t have a “submit to one URL and redirect to another” in one action.
Your options are: