Modal / Element Conditions

  1. What is the right way to cause a modal to close using Javascript and a toggle hash. I tried to understand the docs but it’s not clear.

  2. I have an element with a condition such as [my_shortcode] = true which causes a warning to show when the result of the shortcode outputs true. During a button click, is there a way to trigger the re-evaluation of that condition which would mean the condition became true, such as whilst updating a Woo Cart?

Thanks, Bill.

Hey Bill,

  1. To close the modal using Javascript, you need this code window.xToggleUpdate('e2367-e4', false);. e2367-e4 in the code is your modal ID which you can inspect using any browser tool. You will need to write your own Javascript to close the modal by adding a hash in the URL. Regretfully, that is beyond the scope of our support. You need to add the window.xToggleUpdate code like the code above to your function.

  2. There is no trigger to re-evaluate conditions.

For both of your concerns, you’d need to hire a developer in case you’re not comfortable with programming. Alternatively, you can sign up to our One service and we’ll recommend some more custom codes for you.