These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Clear Selection in drop-down box

tgoodman
Registered: Aug 18 2008
Posts: 72
Answered

Hi,

Lets say I have a form with an Option drop-down field, with options "OPTION 1" and "OPTION 2".

If a user selects an Option (by accident, and wants to CLEAR their selection - how do they do it? ... i.e. they select OPTION 1, but then they want to select

The Delete, backspace & escape keys do not clear, and I don't want to allow custom entry

Do I need to add a check on the change event, and add (or remove) a blank value [This is not ideal]. What is the "best practice"?

I realise this may be an Acrobat question, more that LiveCycle ES...

Thanks,

dk3dknight
Registered: Jan 22 2008
Posts: 136
Your not going to believe this....

Put in a entry that is a single black space by pressing the space bar once you will have a empty slot.

Another method is the reset button but that may reset more then you would want.

There are probably many more ways but there is two.
tgoodman
Registered: Aug 18 2008
Posts: 72
I added a blank row, but the customer hates it. It means when they go in, there are effectively two blank rows ... looks awful. They made me take it out.

Using a space also meant that the isNull check can't be used because a space is NOT null.

And a reset button? That's a pain too, makes the form ugly.

So any other ideas?
dk3dknight
Registered: Jan 22 2008
Posts: 136
Okay fine.. how about a button that is very small next to the box that say only contains a minus sign.

- small little box.

YourDropDownListName=""

How about that..

Remember to set the button to visible screen only.

|||||||||||||| | |-|

Also its possible to hide fields from the view and bring them to view when they are needed.

YourFieldName.presence="visible"
YourFieldName.presence="invisible"

I have to admit your customer is different then my boss, my boss could not live without a blank row in the drop down.

Im hoping I gave you enough ammo to accomplish what you need.
gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4308
Have you tried to reset the field with FormCalc or JavaScript for a mouse click action for a button?

$host.resetData([ STRING param ])

George Kaiser

tgoodman
Registered: Aug 18 2008
Posts: 72
Ah yep - that probably works best ... but I placed it on the MouseDown event (calling from the click event also hid the entire dropdown selection container)

..The entire syntax I used was:


form1.#subform[0].DropDownList1::mouseDown - (JavaScript, client)

if (!this.isNull)
xfa.host.resetData("xfa.form.form1.DropDownList1");