• Resolved exc1usive

    (@exc1usive)


    Hello!

    I have a Multiselect Dropdown field defined with the following options: null_select::Only native language, Bulgarian, Croatian, Czech, Danish, Dutch, English, … and so on. The field is not required, and I was expecting if user was not selecting any values from the list, the option “Only native language” was set. If user made selection, and then he wanted to reset the value, he could select “Only native language” from the list. But, the value saved in database is blank. And, the same behaviour occurs if I edit profile for the user from wp-admin console.
    What can cause this problem?
    I use custom template to show record, but I don’t mess with the way how the fields are displayed.

    [pdb_record template=custom record_id='{$record_id}’ fields=’first_name,last_name,age,country,city,native_language,additional_languages,email,phone,skype,whatsapp,telegram’]

    Also tried to set default value to “Only native language”, but no luck.
    Thanks in advance!

    • This topic was modified 6 years, 11 months ago by exc1usive.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author xnau webdesign

    (@xnau)

    The null select option does not save a value, that is its purpose.

    If you want to set up a default value, just add it as a normal value to the options, then put its value into the default for the field.

    Thread Starter exc1usive

    (@exc1usive)

    Thank you for the answer!

    But, what are my options if I don’t want to have blank value in the dropdown list? This blank value disappears only if I set null_select. Even if I mark the field as required, the first choice in the dropdown list if a blank line. I would like to get rid of it.
    Thanks!

    Plugin Author xnau webdesign

    (@xnau)

    The setting for that would be null_select::false

    This is explained here: Nothing Selected Option

    Thread Starter exc1usive

    (@exc1usive)

    Great! For some reason I overlooked this setting.
    Thanks a lot!

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

The topic ‘null_select problem’ is closed to new replies.