Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Combo Box Empty value.

Guest
Dec 02, 2011 Dec 02, 2011

Is there a way to add an empty value to a combo box. For instance, when a user clicks the combo box but then decides to not select anything?

TOPICS
ActionScript
1.9K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Dec 02, 2011 Dec 02, 2011

Then you are probably going to need to add a deselect option to the combobox that when selected will reset the selectedIndex to -1.  Per your earlier question you can add a  blank " " entry to the combobox, though it would likely be better to provide something that explains it as a choice.

I believe what is normally done in optional circumstances is that a checkbox is used to first specify that the option is desired, which in turn makes  the combobox appear.  Deselecting the option would drive th

...
Translate
Guest
Dec 02, 2011 Dec 02, 2011

You can set the prompt property of the comboBox and that will be what shows before the user makes a selection. You can do it either by code:

myCombo.prompt = "Hello There";

Or you can set it in the properties panel for the combo box.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Dec 02, 2011 Dec 02, 2011

I know about the "prompt" option. But once you click into the combo box and the dropdown appears the text in the prompt is gon and from that point you have to make a selection. What if you click and dont want either of the given options?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 02, 2011 Dec 02, 2011

The behavior you describe is not what I find.  If you just click the combobox to open it, the prompt does not go away until you select something.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Dec 02, 2011 Dec 02, 2011

Sorry about the misunderstanding.What if you select something and wish to no longer have a selection. This combo box links to data that is optional.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 02, 2011 Dec 02, 2011
LATEST

Then you are probably going to need to add a deselect option to the combobox that when selected will reset the selectedIndex to -1.  Per your earlier question you can add a  blank " " entry to the combobox, though it would likely be better to provide something that explains it as a choice.

I believe what is normally done in optional circumstances is that a checkbox is used to first specify that the option is desired, which in turn makes  the combobox appear.  Deselecting the option would drive the removal of the combobox.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines