Support

Account

Home Forums Backend Issues (wp-admin) Can't target ACF Form in Admin

Unread

Can't target ACF Form in Admin

  • So, I’ve added an ACF taxonomy field to admin, which looks at the general WP tags. I’m now trying to target the form within the modal popup that opens when you click the + sign at the end of that field as I need to add in a new field.

    Using acf.addAction('append', function( $el ){ I can target the modal popup itself, but for the life of me I can’t target the form within it (which has no ID or name or class) to add in a further field. The HTML looks like the below for reference:

    <div id="acf-popup" class="i-was-here">
    <div class="acf-popup-box acf-box" style="width: 300px;">
    <div class="title"><h3>Add New Tag</h3><a href="#"></a></div>
    <div class="inner">
    <form method="post"> <– trying to target this
    <div class="acf-field acf-field-text" data-name="term_name" data-type="text">
    <div class="acf-label">
    <label for="term_name">Name</label></div>
    <div class="acf-input">
    <div class="acf-input-wrap"><input type="text" id="term_name" name="term_name"></div>
    </div>
    </div>
    <p class="acf-submit">
    <button class="acf-submit-button button button-primary" type="submit">Add</button>
    </p>
    </form></div>

Viewing 1 post (of 1 total)

The topic ‘Can't target ACF Form in Admin’ is closed to new replies.