Can't display select fields

Support MB Frontend Submission Can't display select fields

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #9305
    alessioaalessioa
    Participant

    Hi,

    i make a custom plugin to submit post type via front end, but i have a problem with all select fields, this is my code :

    $values = rwmb_meta( 'scadenza_prodotti_rinnovabili' );
    foreach ( $values as $value ) {
        echo $value;
    }

    this is my meta

    array(
        'id'          => 'scadenza_prodotti_rinnovabili',
        'name'        => 'Scadenza',
        'type'        => 'select',
        'placeholder' => 'Seleziona',
        'options'     => array(
            'Mensile'     => 'Mensile',
            'Trimestrale' => 'Trimestrale',
            'Semestrale'  => 'Semestrale',
            'Annuale'     => 'Annuale',
        ),
        'visible'     => array(
            'when'     => array(
                array( 'domanda_prodotto_rinnovabile', '=', '1' ),
            ),
            'relation' => 'or',
        ),
    ),

    also i have another select with some conditional statement but i cant display in my form

    Thanks.

    #9311
    Anh TranAnh Tran
    Keymaster

    Hi, your select field is just a normal select without clone or multiple, so to get its value, simply remove the foreach loop in your code:

    $value = rwmb_meta( 'scadenza_prodotti_rinnovabili' );
    echo $value;
Viewing 2 posts - 1 through 2 (of 2 total)
  • The topic ‘Can't display select fields’ is closed to new replies.