How can I add a popup condition to a custom section?

How to add a pop up condition for a custom section here:
{%- if form.posted_successfully? -%}
X
{%- endif -%}

Thank you!

All good!

For future readers can you please elaborate what the solution was “all good” “fixed” etc communicates nothing to other people with the same issue.

https://xkcd.com/979/