Title: Conditional visibility based on programmatically changed fields
Last modified: October 31, 2023

---

# Conditional visibility based on programmatically changed fields

 *  Resolved [vivalis](https://wordpress.org/support/users/vivalis/)
 * (@vivalis)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/conditional-visibility-based-on-programmatically-changed-fields/)
 * Dear Forminator team,
 * I’d like to report on a problem that is related to this question: [https://wordpress.org/support/topic/hidden-fields-still-unusable-for-conditional-visibility/](https://wordpress.org/support/topic/hidden-fields-still-unusable-for-conditional-visibility/):
 * Field A has conditional visibility based on the value of field B. If the value
   of field B changes programmatically (Javascript), it doesn’t trigger the conditional
   visibility of field A.
 * Just to let you know. I’ve worked around this problem with the Javascript code
   directly triggering the jQuery hide and show methods.
 * Kind regards, Roger

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Support [Saurabh – WPMU DEV Support](https://wordpress.org/support/users/wpmudev-support7/)
 * (@wpmudev-support7)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/conditional-visibility-based-on-programmatically-changed-fields/#post-17166002)
 * Hi [@vivalis](https://wordpress.org/support/users/vivalis/)
 * Hope you’re doing well today!
 * I checked with our SLS team and it looks to be an expected behaviour when the
   change is made programmatically. To trigger the conditions you will have to use
   the JQuery trigger change method so the visibility conditions are updated, something
   like below
 * `jQuery('#text-2 input').val('hi').trigger('change');`
 * Further, this way it would also remove the need to use the JQuery hide and show
   method and it would be no longer needed.
 * Hope this helps. Please let us know in case you have any queries.
 * Kind Regards,
    Saurabh
 *  Thread Starter [vivalis](https://wordpress.org/support/users/vivalis/)
 * (@vivalis)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/conditional-visibility-based-on-programmatically-changed-fields/#post-17166418)
 * Dear Saurabh,
 * Thanks for your answer. I tested it in the console, and it’s working now. Maybe
   I did something wrong on my side.
 * However, there’s another problem with conditionally hidden fields: I have a text
   field A with conditional visibility. That field A gets filled with a result by
   JS code. Then, there’s html field B that shows some text and the result from 
   A. When A is hidden by condition, it’s content doesn’t show up in B.
 * Could you check if you can replicate this problem?
 * Kind regards, Roger
 *  [Kris – WPMU DEV Support](https://wordpress.org/support/users/wpmudevsupport13/)
 * (@wpmudevsupport13)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/conditional-visibility-based-on-programmatically-changed-fields/#post-17169726)
 * Hi [@vivalis](https://wordpress.org/support/users/vivalis/)
 * I pinged our SLS Team so that they can review your query. We will post an update
   here as soon as more information is available.
 * Kind Regards,
   Kris
 *  [Kris – WPMU DEV Support](https://wordpress.org/support/users/wpmudevsupport13/)
 * (@wpmudevsupport13)
 * [2 years, 6 months ago](https://wordpress.org/support/topic/conditional-visibility-based-on-programmatically-changed-fields/#post-17214676)
 * Hi [@vivalis](https://wordpress.org/support/users/vivalis/)
 * I apologize for the delay.
 * It seems you’re using macro of text field(A) in the HTML field(B) and because`
   it's hidden by condition` that’s why not showing in the HTML. Could you please
   confirm if you want hidden field data too in the HTML?
 * Kind Regards,
   Kris
 *  Plugin Support [Amin – WPMU DEV Support](https://wordpress.org/support/users/wpmudev-support2/)
 * (@wpmudev-support2)
 * [2 years, 6 months ago](https://wordpress.org/support/topic/conditional-visibility-based-on-programmatically-changed-fields/#post-17232687)
 * Hello [@vivalis](https://wordpress.org/support/users/vivalis/) ,
 * It looks like you don’t need our further help as it’s been over a week without
   your response, so I will resolve this topic.
 * kind regards,
    Kasia

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Conditional visibility based on programmatically changed fields’ is closed
to new replies.

 * ![](https://ps.w.org/forminator/assets/icon-256x256.gif?rev=3443182)
 * [Forminator Forms – Contact Form, Payment Form & Custom Form Builder](https://wordpress.org/plugins/forminator/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/forminator/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/forminator/)
 * [Active Topics](https://wordpress.org/support/plugin/forminator/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/forminator/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/forminator/reviews/)

 * 5 replies
 * 4 participants
 * Last reply from: [Amin – WPMU DEV Support](https://wordpress.org/support/users/wpmudev-support2/)
 * Last activity: [2 years, 6 months ago](https://wordpress.org/support/topic/conditional-visibility-based-on-programmatically-changed-fields/#post-17232687)
 * Status: resolved