# Target rules not working in forms

**URL:** <https://community.hubspot.com/t/target-rules-not-working-in-forms/86726>\
**Category:** Lead Capture Tools\
**Tags:** professional\
**Created:** [August 3, 2023, 9:56am UTC](https://community.hubspot.com/t/target-rules-not-working-in-forms/86726 "2023-08-03T09:56:29Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![DR29](https://avatars.discourse-cdn.com/v4/letter/d/2acd7d/32.png) [@DR29](https://community.hubspot.com/u/DR29)\
**Post date:** [August 3, 2023, 9:56am UTC](https://community.hubspot.com/t/target-rules-not-working-in-forms/86726/1 "2023-08-03T09:56:29Z")

</div>

My application is a React application. I indicated in the form targeting rule that forms should not be displayed on certain pages. However, this does not occur. Only refreshing the page causes the form to vanish.

---

<div class="post-metadata">

**Author:** ![Berangere](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/berangere/32/220784_2.png) [@Berangere](https://community.hubspot.com/u/Berangere)\
**Post date:** [August 4, 2023, 7:55am UTC](https://community.hubspot.com/t/target-rules-not-working-in-forms/86726/2 "2023-08-04T07:55:16Z")

</div>

Hi @DR29,  
Thank you for reaching out to the Community!  
I understand that you are using a pop-up form and that the exclusion rule in the “target” tab doesn’t work, is that right, please?  
Just to make sure that I understand correctly, I’d like to ask clarifying questions:  
- Did you add triggers for the form to disappear too please? If yes, what are they?  
- The pop-up is appearing on all pages then? Instead of being only on some of the pages.  
- Are the pages placed after a login page or accessible to all visitors?  
The more info, screenshots (without sensitive/confidential information), and details you can provide, the better the Community can assist.  
I found these articles for you that might be of interest:  
- [Pop-up forms and non-HubSpot forms | Frequently Asked Questions](https://knowledge.hubspot.com/forms/pop-up-forms-and-non-hubspot-forms-faq)  
- [Use targeting rules in pop-up forms and chatflows](https://knowledge.hubspot.com/forms/use-targeting-rules-in-pop-up-forms-and-chatflows)  
- [Troubleshoot HubSpot forms](https://knowledge.hubspot.com/forms/troubleshoot-hubspot-forms)  
I also wanted to invite a couple of subject matter experts to this conversation @danmoyle, @Jnix284 and @deepikaverma do you have any suggestions to help @DR29, please?  
**Also, if anybody else has anything to add and/or share, please feel free to join in the conversation 🙂**  
Thank you and have a good day!  
Best,  
Bérangère

---

<div class="post-metadata">

**Author:** ![DR29](https://avatars.discourse-cdn.com/v4/letter/d/2acd7d/32.png) [@DR29](https://community.hubspot.com/u/DR29)\
**Post date:** [August 4, 2023, 9:20am UTC](https://community.hubspot.com/t/target-rules-not-working-in-forms/86726/3 "2023-08-04T09:20:59Z")

</div>

Hi [BérangèreL](https://community.hubspot.com/t5/user/viewprofilepage/user-id/230185),

Actually I didnt add any triggers for the form to disappear. Chatflow has triggers like window.hubspotconversation.refresh() . But I didnt see any functions like this in forms. Yes , right hubspot appears in all the pages. I added the target rules in hubspot just like chatflow.

---

<div class="post-metadata">

**Author:** ![jnix284](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jnix284/32/29_2.png) [@jnix284](https://community.hubspot.com/u/jnix284)\
**Post date:** [August 4, 2023, 7:33pm UTC](https://community.hubspot.com/t/target-rules-not-working-in-forms/86726/4 "2023-08-04T19:33:19Z")

</div>

@DR29 is there something preventing your React application from loading? Since it works on refresh, it sounds like there’s something on initial page load that’s preventing it from firing correctly.
