• Resolved brening

    (@brening)


    Hallo
    I use the function UM()->fields()->edit_field(‘my_key’) to get an editable select field in ‘input mode’. But the select field is displayed without the selected option. I am sure, that the selected option is stored in the database.Please tell me, how to solve this problem.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi @brening

    Have you tried the following?

    
    $data['default'] = um_user("my_key");
    UM()->fields()->edit_field(‘my_key’, $data );
    

    Regards,

    Thread Starter brening

    (@brening)

    Small part of my code:

    $fields = array('my_key');
    $data = [];
    foreach ($fields as $field) {
       $data[$field] = UM()->builtin()->get_specific_field($field);
    }
    $data = apply_filters('um_account_secure_fields', $data, $User_id);
    UM()->fields()->edit_field('my_key', $data['my_key']);
    • This reply was modified 3 years, 8 months ago by brening.
    Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi @brening

    Does it work? Are you trying to create fields in the Account form?

    Regards,

    Thread Starter brening

    (@brening)

    Yes, this code works for other fields. I output a form for entering user data.

    Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi @brening

    Thanks for letting us know. I am closing this thread now.

    Regards,

    Thread Starter brening

    (@brening)

    No, it doesn’t work for select field.

    Thread Starter brening

    (@brening)

    Hello! I got it wrong. My problem is still relevant. Can you help?

    Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi @brening

    Sorry for the late response.

    Could you please tell us if you’re still having issues?

    Feel free to re-open this thread by changing the topic status to “Not Resolved” so that we can get back to you.

    Regards,

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Select-field empty’ is closed to new replies.