Support

Account

Home Forums General Issues Change validatation message's div position

Solved

Change validatation message's div position

  • I am using acf_form.
    I want to move the “<div class=”acf-error-message”>” after “<div class=”acf-input-wrap”>”
    So from this:

    <div class="acf-input">
       <div class="acf-error-message">
       <div class="acf-input-wrap">
    </div>

    to this:

    <div class="acf-input">
       <div class="acf-input-wrap">
       <div class="acf-error-message">
    </div>
  • These messages are added using JavaScript. It may be possible to move it, but it won’t be pretty. You’ll need to add custom JS, see this https://www.advancedcustomfields.com/resources/adding-custom-javascript-fields/

    There is an action fired when the error message is added add_field_error and one fired when it is removed. remove_field_error. The main problem that I see is that if you move it then ACF won’t be able to find it to remove so the remove action won’t fire. You’d basically need to add your own error message when ACF adds it and then remove your error message when ACF removes it and hide the ACF messages with custom CSS.

    That’s the best information I can tell you, I have not dealt with the error messages before. I can say that it is possible, I just can give you any code that will accomplish it.

Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘Change validatation message's div position’ is closed to new replies.