Support

Account

Home Forums General Issues Populate text field with post id on submission Reply To: Populate text field with post id on submission

  • The code you posted is for populating the choices of a select field and will not work for adding a value to a text field.

    You cannot populate the post ID into a text field on a front end form, assuming you are using acf_form() before the new post is created. This could only be done after the post is created.

    See acf/save_post

    The post ID is passed to your action and then you can use update_field() to insert set the field.