Custom Fields
Re-Envisioned
Support MB Frontend Submission Group "std" doesn't work on frontend ?

This topic contains 5 replies, has 2 voices, and was last updated by  Anh Tran 3 days, 10 hours ago.

  • Creator
    Topic
  • #16467

    Kevin
    Participant

    Hi,

    is the “std” paramters of group filedtype is working with front end submission/edition, i can see it works on backend but i need it to work on front end, and it doesn’t seems to do so :/

    I’ve already tested rwmb_frontend_field_{attributes} (both query and hook), unsuccessfully.

    Hope you can help on this

    have a nice day,
    Kevin

Viewing 5 replies - 1 through 5 (of 5 total)
  • Author
    Replies
  • #16479

    Anh Tran
    Keymaster

    Hi Kevin, the std param should work on both back end and front end. I added some docs on setting std for groups a couple of days ago, please take a look.

    #16482

    Kevin
    Participant

    Hi Anh,

    i did, here’s my code (set in fields, as i say, everything works fine on backend) :

     array (
                    'id' => $prefix . 'traitements_concomitants',
                    'type' => 'group',
                    'fields' => array(
                        array (
                            'id' => $prefix . 'nom_medicament',
                            'type' => 'text',
                            'name' => esc_html__( 'Nom du médicament (DCI)', 'kallyas' ),
                        ),
                        array (
                            'id' => $prefix . 'posologie_medicament',
                            'type' => 'text',
                            'name' => esc_html__( 'Posologie', 'kallyas' ),
                        ),
                        array (
                            'id' => $prefix . 'voie_medicament',
                            'type' => 'text',
                            'name' => esc_html__( 'Voie', 'kallyas' ),
                        ),
                        array (
                            'id' => $prefix . 'en_cours_medicament',
                            'type' => 'checkbox',
                            'desc' => esc_html__( 'En cours', 'kallyas' ),
                            'std' => 1,
                        ),
                        array (
                            'id' => $prefix . 'date_fin_medicament',
                            'type' => 'date',
                            'name' => esc_html__( 'Date de fin', 'kallyas' ),
                            'desc' => esc_html__( 'JJ/MM/AA', 'kallyas' ),
                            'hidden' => array(
                                'when' => array(
                                    array (
                                        0 => 'en_cours_medicament',
                                        1 => '=',
                                        2 => true,
                                    ),
                                ),
                                'relation' => 'and',
                            ),
                        ),
                        array (
                            'id' => $prefix . 'indication_medicament',
                            'type' => 'text',
                            'name' => esc_html__( 'Indication', 'kallyas' ),
                        ),
                    ),
                    'clone' => 1,
                    'sort_clone' => 1,
                    'default_state' => 'expanded',
                    'collapsible' => true,
                    'add_button' => esc_html__( 'Ajouter un traitement', 'kallyas' ),
                    'group_title' => 'Traitement {#}',
                    'std' => array(
                        array(
                            'nom_medicament' => 'Effe',
                            'posologie_medicament' => "1mg",
                            'voie_medicament' => 'Test',
                            'en_cours_medicament' => '0',
                            'date_fin_medicament' => '',
                            'indication_medicament' => 'indication',
                        ),
                        array(
                            'nom_medicament' => 'Effe 2',
                            'posologie_medicament' => "2mg",
                            'voie_medicament' => 'Test 2',
                            'en_cours_medicament' => '1',
                            'date_fin_medicament' => '',
                            'indication_medicament' => 'indication 2',
                        ),
                        
                    )//$traitement_c,
                ),

    thanks for your help

    #16483

    Kevin
    Participant

    just to be sure i’m not missing anything, here’s a pastebin

    https://pastebin.com/YRzuC38S

    #16484

    Kevin
    Participant

    Sorry i wasn’ t clear enough in my previous answer, it sill not working on front end, even with the code set up in the previous pastebin

    #16495

    Anh Tran
    Keymaster

    Hi Kevin, I see the problem. Let me check and fix it.

Viewing 5 replies - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.