Home › Forums › Front-end Issues › If checkbox ticked then add a class › Reply To: If checkbox ticked then add a class
It does seem like a long way around but since the modal is created by JavaScript, we’ll most likely have to use JavaScript to influence to the modal.
The <a>
tag is our link between the HTML and the corresponding JavaScript modal.
In your page template file
Check if the video has Signed set to TRUE, if so add a class (let say “issigned”) to it’s <a>
tag.
<a href="your-url"
<?php if( get_field('signed') ): ?>
<?php echo 'class="issigned"'; ?>
<?php endif; ?>
>
In your Javascript file
When an <a>
with class issigned is clicked, add another class to the modal.
As I mentioned, I’m no expert developer and there might be a better solution to this.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.