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

Show / Hide a combobox from a selection of another combobox?

Rajkurt
Registered: May 19 2010
Posts: 47

Hello!

Is there anyway to hide/show a combobox by a selection of another combobox?
Like the script "this.getField" for textfields but for combobox something like "this.getCombobox"??
I have posted my script below, its when you select "Selection3" i want a combo box to show as well?

// hide all fields to be processed by combo box
this.getField('Textfield1').display = display.hidden;
this.getField('Textfield2').display = display.hidden;
this.getField('Textfield3').display = display.hidden;

// lock the fields
this.getField('Textfield1').readonly = true;
this.getField('Textfield2').readonly = true;
this.getField('Textfield3').readonly = true;

switch (event.value) {
case 'Selection1':
this.getField('Textfield1').display = display.visible;
this.getField('Textfield1').readonly = true;
break;

case 'Selection2':
this.getField('Textfield2').display = display.visible;
this.getField('Textfield2').readonly = true;
break;

case 'Selection3':
this.getField('Textfield3').display = display.visible;
this.getField('Textfield3').readonly = true;

HERE I WANT A SCRIPT TO SHOW A COMBOBOX

break;

default:
// action for all other values
break;
}

Is it possible to do this?

Warm regards
/Rajkurt

My Product Information:
Acrobat Pro 8.0, Macintosh
Rajkurt
Registered: May 19 2010
Posts: 47
I solved it, maybe admin could delete this thread?
siggy_freud
Registered: May 17 2010
Posts: 34
How about you post how you solved it so this thread can be of benefit to others.

Javascript NEWB

Rajkurt
Registered: May 19 2010
Posts: 47
You are absolutley right, im sorry.

This code should be scripted in the first combo box (the one that controls the other field and the new combobox) as a custom keystroke script (Right click on the combobox -> properties -> format -> custom (in the drop down menu) -> Custom Keystroke Script - Edit.// hide all fields to be processed by combo box
this.getField('Textfield1').display = display.hidden;
this.getField('Textfield2').display = display.hidden;
this.getField('Textfield3').display = display.hidden;
this.getField('Combobox').display = display.hidden;

// lock the fields
this.getField('Textfield1').readonly = true;
this.getField('Textfield2').readonly = true;
this.getField('Textfield3').readonly = true;

switch (event.value) {
case 'Selection1':
this.getField('Textfield1').display = display.visible;
this.getField('Textfield1').readonly = true;
break;

case 'Selection2':
this.getField('Textfield2').display = display.visible;
this.getField('Textfield2').readonly = true;
break;

case 'Selection3':
this.getField('Textfield3').display = display.visible;
this.getField('Textfield3').readonly = true;
this.getField('Combobox').display = display.visible;

break;
default:
// action for all other values
break;
}

There you go!
siggy_freud
Registered: May 17 2010
Posts: 34
No worries, I just know that as a Javascript newbie, others will certainly appreciate you posting the solution. There is nothing more frustrating than seeing 5 others threads of problems that you may be experiencing, with no solutions, especially when you know a solution is out there :).

Javascript NEWB