Skip to main content
Participating Frequently
March 30, 2020
Question

change combobox property using personal format action

  • March 30, 2020
  • 1 reply
  • 1004 views

Hello,

I have a combobox that is not modifiable so the user can easily navigate through the list by pressing the first caracter.

This combobox contains an element that should set the combobox property as modifiable ("Other please specity").

 

I have manage to code the event so it change the property of the combobox but it won't actually change he property until it lose the focus. So i am force to set the focus to another field for it to work.

 

p.s: i tried setting the focus on the other field and then back to the combobox and it won't change the property either.

 

	var liste = getFunctionList();
	var value_idx = liste.indexOf(event.change);
	if (event.willCommit == false) {
		if (value_idx == -1) {
		
		}
		else if (value_idx == liste.length -1) {
			event.target.editable = true;
			getField("1.1f.Unite").setFocus();
		}
		else if ( value_idx < liste.length -2 )  {
			event.target.editable = false;
			getField("1.1f.Unite").setFocus();			
		}

	}

 Is there an event or a way that would allow me to set the combobox as modifiable when the last item is selected else set it as non modifiable without having to quit the combobox?

 

Thanks

This topic has been closed for replies.

1 reply

yanipAuthor
Participating Frequently
March 30, 2020

This is such an easy thing to do with LiveCycle but Acrobat pro seems to be missing many feature like such.

Thom Parker
Inspiring
March 30, 2020

Is the combobox set to "Commit value immediately"?  This property is on the "Options" tab of the field properties.

 

 

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
yanipAuthor
Participating Frequently
March 30, 2020

Hello Thom,

No it wasn't checked, but if I check the option the focus still goes out.
I tried ot add a new statement in the function to give it back the focus if the user select Other please specity but still the focus doesn't return after the commit.