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

Check box/Text box code problems

knix
Registered: Aug 2 2010
Posts: 21

Here is a picture of what I am looking at. I want the text box to read "With parents, and parents to bring all needed supplies" when the check box is checked.

[img]http://i133.photobucket.com/albums/q62/tandknix/RegionCapture3.jpg[/img]

I am new to writing my own code, but here is the code I have written so far. Can someone please tell me what I am doing wrong?

event.value = this.getField ('Intake Questionnaire Home Nursing Services Allowed with Restrictions).value;
if (event.value == 'Allowed, With Restrictions') event.value = 'With parents, and parents to bring all needed supplies';
if (event.value == 'Off') event.value = ' '; //adjust for 'Off' of unchecked value

Please help!

gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4308
Where is this code located :

Check box keystroke?
Chcek box mouse up action?
text box calculate?

What are the field names for the;
Check box?
Text field?

I would place the code in the 'Mouse up' action for the check box.

When the check box is selected, the event value for the check box will be something other than 'Off'.
// script for check box mouse up action// name for the text fieldvar cTextField = "RestrictionsText";// do not change any text below this line// define text field objectvar oTextField = this.getField(cTextField);oTextField.value = "";if (this.getField(event.target.name).value != "Off") {// check box has been checkedoTextField.value = 'With parents, and parents to bring all needed supplies';}

George Kaiser

knix
Registered: Aug 2 2010
Posts: 21
Thanks for your reply. My check box field name is: "Intake Questionnaire Home Nursing Services Allowed with Restrictions" and its value is "Allowed with Restrictions"

And my text box field name is "Intake Questionnaire Home Nursing Services Restrictions".

I located the code I wrote in the Custom Calculation Script box.

What does placing it in the "Mouse up" action for the check box mean? Does that mean when it's clicked this action will run?