# Page Redirect After Successful Form Completion - Collected Forms

**URL:** <https://community.hubspot.com/t/page-redirect-after-successful-form-completion-collected-forms/652>\
**Category:** Lead Capture Tools\
**Tags:** forms, contacts\
**Created:** [January 6, 2017, 1:27am UTC](https://community.hubspot.com/t/page-redirect-after-successful-form-completion-collected-forms/652 "2017-01-06T01:27:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tdodge](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/tdodge/32/30597_2.png) [@tdodge](https://community.hubspot.com/u/tdodge)\
**Post date:** [January 6, 2017, 1:27am UTC](https://community.hubspot.com/t/page-redirect-after-successful-form-completion-collected-forms/652/1 "2017-01-06T01:27:26Z")

</div>

Hi there,

I made the very expensive mistake of having a javascript redirect and the collected forms snippet tied to the submission button on my form. Apparently you can’t have any other scripts associated with the button.

How do I perform a redirect if I can’t use custom javascript on the button? I’d like to at least acknowledge the customer for completing the form.

Any help would be appreciated.

---

<div class="post-metadata">

**Author:** ![relabidin](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/relabidin/32/10664_2.png) [@relabidin](https://community.hubspot.com/u/relabidin)\
**Post date:** [January 6, 2017, 2:53pm UTC](https://community.hubspot.com/t/page-redirect-after-successful-form-completion-collected-forms/652/2 "2017-01-06T14:53:59Z")

</div>

Hi @tdodge,

I did a little research on JavaScript form redirects and I found this Stackoverflow article that might be helpful: [http://stackoverflow.com/questions/24140727/redirecting-after-form-submit](http://stackoverflow.com/questions/24140727/redirecting-after-form-submit)

Apparently, you can add the destination URL to the Action in the form tag to have it redirect post submit without targeting the submit button directly.

```auto
<form id="yourForm" action="redirectURLGoesHere">
</form>

```

Rami

---

<div class="post-metadata">

**Author:** ![tdodge](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/tdodge/32/30597_2.png) [@tdodge](https://community.hubspot.com/u/tdodge)\
**Post date:** [January 25, 2017, 8:14am UTC](https://community.hubspot.com/t/page-redirect-after-successful-form-completion-collected-forms/652/3 "2017-01-25T08:14:31Z")

</div>

Hey @relabidin,

Thanks for the response and please accept my apologies for how long it’s taken me to do so. I ended up finding the same work around as you and it works beautifully.

Thanks so much!

---

<div class="post-metadata">

**Author:** ![agdupz](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/agdupz/32/76793_2.png) [@agdupz](https://community.hubspot.com/u/agdupz)\
**Post date:** [September 12, 2017, 1:09pm UTC](https://community.hubspot.com/t/page-redirect-after-successful-form-completion-collected-forms/652/4 "2017-09-12T13:09:57Z")

</div>

Hi Rami,

I have a similar issue, maybe you can help me as well?

I have a landing page with a form, after submit is pressed it should run the Collected Form script, send the data to HS, and then redirect to “thanks” page.

My problem is that when I set the action in the form tag as above, the page redirects successfully but the form data is not picked up. Strangely enough, if I then go back to the original landing page (via “back” or refresh) the form data is then sent to HS.

Without the action in the form tag, the data is picked up but the page doesn’t redirect after submit. Every attempt to put the redirect elsewhere in the page code (whether via button action, onclick method, or additional JS) just doesn’t trigger.

Thanks in advance!
