Skip to Content Skip to Menu

[SOLVED] dropdown empty value

  • erilam
  • erilam
  • OFFLINE
  • Posts: 787
  • Thanks: 98
  • Karma: 22
10 years 4 months ago - 10 years 4 months ago #246369 by erilam
[SOLVED] dropdown empty value was created by erilam
Hello,

I'm searching a way (I didn't find in the doc or here) to display a string on a dropdown value as this :

Displayed value "Please select a value" (equal no choice)
choice one : A
Choice two : B
Etc...

Do you have any idea to make this ?
Thx for answers

Eric Lamy (erix)
www.agerix.fr/
Last edit: 10 years 4 months ago by erilam. Reason: answer given by Kyle

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48478
  • Thanks: 8282
  • Karma: 1443
10 years 4 months ago #246383 by krileon
Replied by krileon on topic dropdown empty value
A blank value? No, that's not possible. The blank value is automatically added internally and it has no label. It's based off the field being required or not. Allowing a custom blank value would break the validation. You could do something like the below by using a language string.

Value: UE_PLEASE_SELECT_VALUE

'UE_PLEASE_SELECT_VALUE' => 'Please select a value'

Next you'd use CB Conditional and condition the fields profile display and if its value is equal to UE_PLEASE_SELECT_VALUE then hide it.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

  • erilam
  • erilam
  • OFFLINE
  • Posts: 787
  • Thanks: 98
  • Karma: 22
10 years 4 months ago #246384 by erilam
Replied by erilam on topic dropdown empty value
Well as I answer in the french forum I use a similar way but with delimiter field Meybe it could be a good idea to add a option in this kind of field in CB 2.0.
As we have a Pre-filled default value at registration in the list of settings, may be we could also have a blank value ?

Eric Lamy (erix)
www.agerix.fr/

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48478
  • Thanks: 8282
  • Karma: 1443
10 years 4 months ago #246388 by krileon
Replied by krileon on topic dropdown empty value
With CB 2.0 the value and label can be separate so you'd do the below.

Value: 0
Label: Please select a value

Then in your layout you can have an if check for it like the below.

[cb:if cb_select!="0"][value][/cb:if]

There's a lot more options available for CB 2.0 to accomplish this. For CB 1.x you can use CB Conditional or a delimiter field.

As we have a Pre-filled default value at registration in the list of settings, may be we could also have a blank value ?

That parameter is to set the default selected value at time of registration. It only works if the field is displayed on registration. It doesn't add a new option or anything of the sort.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

  • erilam
  • erilam
  • OFFLINE
  • Posts: 787
  • Thanks: 98
  • Karma: 22
10 years 4 months ago #246395 by erilam
Replied by erilam on topic dropdown empty value
Excellent , exactly what I want ! ;)

Eric Lamy (erix)
www.agerix.fr/
The following user(s) said Thank You: krileon

Please Log in or Create an account to join the conversation.

  • erilam
  • erilam
  • OFFLINE
  • Posts: 787
  • Thanks: 98
  • Karma: 22
10 years 4 months ago #246396 by erilam
Replied by erilam on topic dropdown empty value

krileon wrote:

As we have a Pre-filled default value at registration in the list of settings, may be we could also have a blank value ?

That parameter is to set the default selected value at time of registration. It only works if the field is displayed on registration. It doesn't add a new option or anything of the sort.


I know that, it was a suggest for CB2 but you have answered for that. I must find a moment to install CB2 and test it. I said it to Beat during the JoomlaDay in Paris but I was in hurry last two months. It will be easier in two weeks ;)

Eric Lamy (erix)
www.agerix.fr/
The following user(s) said Thank You: krileon

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum