Home Forums Front-end Issues Customized front-end forms


Customized front-end forms

  • Hello everyone!

    I’m sorry if this is a topic that has already been adressed, but I’ve been searching for a few hours now and haven’t found anything, so I thought I’d give a try and ask for some help.

    I have a custom post type called “Demands” that I have linked with ACF and have a front-end form set up for handling the submitting and editing of new demands using acf_form_head() , acf_form( $settings ) some JS and a custom function called with the acf/pre_save_post filter.

    Up until now, I’ve had no problems, but today I wanted to rework it, as to make it more readable and enhancing the overall UX (making multiple related fields on the same line, using a button that will act as a submit button instead of radio button to change a meta property…)

    So for that, I’ve tried copy pasting the html generated by the form and adapting it, changing the value for _acf_post_id and I haven’t touched anything I thought could be used by ACF in acf/pre_save_post. This includes the data-name and data-key of each input, the acf classes. The only thing I haven’t figured how to change are the _acf_form and _acf_nonce inputs, and I can see why they’d be at the origin of my issue, but I don’t know how generate one the same way acf_form( $settings ) would.

    My issue being that now, when my JS now calls the submit button to submit the form (as it did previously), the page reloads, but the acf/pre_save_post hook isn’t called, and everything I’ve tried haven’t yielded any results, and I don’t know what I could try to correct the issue, or if it’s even possible to not use the acf_form( $settings ) function.

    Anyway, thanks for reading, and thanks to anyone that feels like helping!

Viewing 1 post (of 1 total)

The topic ‘Customized front-end forms’ is closed to new replies.