Support

Account

Home Forums General Issues Where is the best place for updating hidden fields in acf_form()? Reply To: Where is the best place for updating hidden fields in acf_form()?

  • At final I reject acf_form() because I don’t know how can I use it with hidden fields.

    I think ACF need the setting “Hidden in front-end: true/false” and the parameter acf_form() “input_init_values” => $init_values.

    For example, how must I do with acf_form():
    Question post about some item:
    1) item_id (hidden for user in front-end)
    2) title
    3) message

    Without acf_form() it will be:

    <form action="<?php echo get_stylesheet_directory_uri() ?>/question-update.php" method="POST">
    <input type="hidden" name="item_id" value="<?php echo get_the_ID() ?>" />
    <input type="text" name="title" value="" />
    <input type="textarea" name="message" value="" />
    </form>