# Forms post-submission conditional logic

**URL:** <https://community.hubspot.com/t/forms-post-submission-conditional-logic/43243>\
**Category:** CMS Development\
**Tags:** forms\
**Created:** [September 1, 2021, 5:23pm UTC](https://community.hubspot.com/t/forms-post-submission-conditional-logic/43243 "2021-09-01T17:23:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![delmer](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/delmer/32/35926_2.png) [@delmer](https://community.hubspot.com/u/delmer)\
**Post date:** [September 1, 2021, 5:23pm UTC](https://community.hubspot.com/t/forms-post-submission-conditional-logic/43243/1 "2021-09-01T17:23:54Z")

</div>

When a visitor submits my form, does anyone know how to “redirect to another page” based on conditional logic? I have a form that is attempting to “pre-qualify” the visitor. If they submit certain form responses, they are to be directed to a “success” page else they are shown a “you don’t qualify” page.

---

<div class="post-metadata">

**Author:** ![Teun](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/teun/32/28739_2.png) [@Teun](https://community.hubspot.com/u/Teun)\
**Post date:** [September 1, 2021, 5:45pm UTC](https://community.hubspot.com/t/forms-post-submission-conditional-logic/43243/2 "2021-09-01T17:45:21Z")

</div>

@delmer , I do not think there is a functionality available for this. So you might need to [customze the Form Embed code](https://legacydocs.hubspot.com/docs/methods/forms/advanced_form_options) and write your logic there using the _onFormSubmitted_ callback. You should be able to do something like this:

```lia-code-sample
hbspt.forms.create({
 portalId: '',
 formId: '',
 onFormSubmitted: function($form) {
 if ($('input[name="firstname"]').val() === 'something') {
 window.location.href = 'https://example.com'
 } else {
 window.location.href = 'https://example.com'
 }
 } 
}); 

```

---

<div class="post-metadata">

**Author:** ![delmer](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/delmer/32/35926_2.png) [@delmer](https://community.hubspot.com/u/delmer)\
**Post date:** [September 3, 2021, 2:49pm UTC](https://community.hubspot.com/t/forms-post-submission-conditional-logic/43243/3 "2021-09-03T14:49:25Z")

</div>

Thank you, Teun!

---

<div class="post-metadata">

**Author:** ![Marcotwoconnect](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/marcotwoconnect/32/202943_2.png) [@Marcotwoconnect](https://community.hubspot.com/u/Marcotwoconnect)\
**Post date:** [November 7, 2024, 11:57pm UTC](https://community.hubspot.com/t/forms-post-submission-conditional-logic/43243/4 "2024-11-07T23:57:41Z")

</div>

Hi Teun, I tried your solution but I’m not too good at codes. can you please help me out? Here is the website: [Leading Australian Outsourcing for Remote Staff | Twoconnect](https://twoconnect.com.au/) the form is at the bottom. I want redirect them to the [Careers page](https://twoconnect.com.au/careers/) if they choose the “Job Opportunity” in the dropdown field. This is how I set it up, am I doing it right?

 ![2024-11-08_7-56-17.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/5/3/530a224343fe7c419316af693980534fd8ab4c58.png)
