Home Forums ACF PRO Change input name


Change input name

  • Hi, I’m building a frontend-form and I need to create the fields by hand.

    I’m able to do this by calling acf_form(array(‘fields’ => array(‘field1′,’field2’),

    The problem is that when the field gets created, it has its internal name:

    <input id=”acf-field_5644ca0ecae0b” class=”” type=”text” placeholder=”” value=”” name=”acf[field_5644ca0ecae0b]”>

    How could I have them loaded with the name I assigned ?

  • The input names of ACF fields cannot be changed. Doing so would prevent ACF from saving the values when the form is submitted.

  • I’ve found a workaround/cheat for this.

    You can create the form as usual, export it as json, modify the field keys in the json, save and import them 🙂

  • Are you using acf 4 or 5. In 5 the field keys must begin with “field_”, while you can change the field keys as outlined above, doing so will break ACF5.

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

You must be logged in to reply to this topic.