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

Checkbox enables TextField

unleashedmaniac
Registered: Oct 13 2009
Posts: 18
Answered

I have a form that has about 50 checkboxes and 50 related TextFields (each checkbox has a TextField). I'm trying to find a way to remove the TextFields from the tab order unless their checkbox is checked.

(psudo code... ) something like:
if (CheckBox == "Checked")
{
TextField = Editable
}
else
{
TextField = Not in Tab Order ("Protected"?)
}

On a side note, the tab order on the form is CheckBox, TextField, CheckBox, TextField, CheckBox, TextField... Should I be using the Checkbox "Exit" to run my Javascript, or another option?

Thanks,

James

My Product Information:
LiveCycle Designer, Windows
pddesigner
Registered: Jul 9 2006
Posts: 858
Here's a suggested alternative:

In the Script Editor, set Language to JavaScript, Run at: client

Show: change

Add this script to the check box

if (this.rawValue == 1){
TextField1.presence = "invisible";
}else{
TextField1.presence = "visible";
}

You'll need to add this script to each check box and change the name of the TextField eg. TextField2, TextField3, and etc.

My favorite quote - "Success is the ability to go from one failure to another with no loss of enthusiasm.

unleashedmaniac
Registered: Oct 13 2009
Posts: 18
This worked for me.... Thanks!

I set the properties of my TextFields to invisible by default, then used your code to enable and disable them.

James