Expand my Community achievements bar.

How to clear a selection from a dropdown box?

Avatar

Level 1

I have created a table in  LiveCycle using a dropdown box with options to select "1", "2", or "3".   The problem I am having is when I open the PDF from the user's  perspective... Once I select any of the available options, I can't clear  them out of the box.  This is a problem if the user accidentally  selected something, but really needs to leave the space blank.  Delete  and backspace won't work, and I'm basically stuck with a value once one  has been selected.

How can I make it so that users can  delete the selected value to make it a blank cell again?  I am a  beginner at LiveCycle and FormCalc, so a step-by-step answer would be  most greatly appreciated!  Thanks!

1 Reply

Avatar

Level 10

You can have a option in the dropdown with one space as text and assign some value to it..

When the user would like to deselect the in the dropdown, the user can simply change the option to space (which is obviously the first option in the list)..

In your code, you need to check for that value and do the processing only if the user selects a value other than the space.

For example:

Your options in the dropdown could be

Text           Value

--------          ----------

(Space)      0

1111          1111

2222          2222

3333          3333

4444          4444

if(dropdown.rawValue != "0"){

     //Do the processing steps.

}

If you want to set it to default value thru code:

     dropdown.rawValue = "0";

Hope this helps.

Thanks

Srini