Home Forums Front-end Issues adding select menu to front end form


adding select menu to front end form

  • hello,

    I am creating a search form in my theme. In this form I want a select menu that uses the choices from the custom field I created (see attached for custom field)

    I would also like to do this with checkboxes for another custom field.

      $field = get_field_object('field_XXXXXXXX'); // field key of your field
      if (!empty($field['choices'])) {
          <select name="your-field-name">
              foreach ($field['choices'] as $v => $l) {
                ?><option value="<?php echo $v; ?>><?php echo $l; ?></option?<?php 
  • I know that is an old topic but it worked for me also and I have a question.
    How can we save the selected value from this select field?
    I tried with the following code but it returns null update_field($field, $field['value']

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

The topic ‘adding select menu to front end form’ is closed to new replies.