Hide the drop down list arrow once the field is filled

mdawn50

24-07-2015

I am creating a form that ultimately becomes a published page of directions. After the user selects an item in the drop down list, is there a way to make the arrow hidden. It would need to be redisplayed if the user click in the field again.

Thanks,

MDawn

Accepted Solutions (1)

Accepted Solutions (1)

mdawn50

27-07-2015

Here is the script I put on the Exit event of the drop down list. Nothing is happening. I don't get any error messages either.

form1.#pageSet[0].Page1.deptList::exit - (JavaScript, client)

if(xfa.event.newText == "3")

     {deptList.access="readOnly";}

if(xfa.event.newText == "5")

     {deptList.access="readOnly";}

    

     if(xfa.event.newText == "7")

     {deptList.access="readOnly";}

    

     if(xfa.event.newText == "8")

     {deptList.access="readOnly";}

The numbers are the values, not the rawValue.

Thanks for your help.

MDawn

Answers (4)

Answers (4)

mdawn50

27-07-2015

Well, I'm making progress based on your last email. I moved the script to the change event and it works perfectly. Now, I'm not sure how to get the ability to reshow the drop down arrow if the user re-enters field.I kept the script in the enter event. The numbers are actually the displayed value, not the rawValue. so that's working ok.

Thanks again for all your help.

MDawn

Magus069

MVP

27-07-2015

Hi there,

the newText property returns the displayed value chosen, if you want the use the numbers, you should use rawValue if you have the property Specify item values checked

Also, the newText property should only be used in the "Change" event, in the exit event it only returns an empty string.

If you want to use a similar property to newText in the exit event, use DropDownList1.getDisplayItem(DropDownList1.selectedIndex);

But because you are using the numbers as conditions in your if statements, you should be using rawValue, and make sure the check box Specify item values is checked!

Hope this help!

Magus069

MVP

27-07-2015

Hi there,

The only way I'd see this possible is:

on the Exit Event of the field, if a value is chosen, you set the access's field to be "readOnly"

on the Enter Event of the field, you set the access's field to be "open"

Hope this help!