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

Hiding text fields

ballbag
Registered: Sep 28 2008
Posts: 3

Hello all,

I'm hoping someone can help, I've been struggling with this basic test form in LiveCycle for a few hours and I must be doing something silly wrong.

I've got a form which has 2 radio buttons and 1 text field. Their names are as follows.

Radio button: rb1
Text field: text

The PDF has been saved as a dynamic PDF form. The default language has been changed to Javascript.

The radio button has its 'change' event populated with the following code

---------------------------------------------------------------------------
form1.subform1.rb1.#field[0]::change - (FormCalc, client)
if (this.rawValue==1) then
text.presence = "visible"
else
text.presence = "hidden"
endif
---------------------------------------------------------------------------

However try as I might, clicking the radio buttons has no effect and the text box will not change.

Can anyone shed any light on this as I really am at a loss.
The exact form I'm using is available at http://www.iclebyte.com/test.pdf

Thanks in advance for any repiles.

My Product Information:
LiveCycle Designer, Windows
suewhitehead
Registered: Jun 3 2008
Posts: 232
Try this. It works for me on my forms.

Put this script in the change event of the checkbox. Be sure to select JavaScript in the Language dropdown above the script editor. The checkbox should be set to 1=On 0 = Off.

if (this.rawValue == 1) //Find out if the checkbox is checked.
{
TextField1.presence = "visible"; //If it is checked then make the text field visible.
}
else
{
TextField1.presence = "invisible"; //If it isn't checked then make the text field invisible .
}
ballbag
Registered: Sep 28 2008
Posts: 3
Thanks very much for your response it is most apprechiated however I actually solved this a couple of days ago. It was the 'Click' event under which the code should have been placed not the change event. Then of course the selection of Javascript as you say.

I should have posted my own answer for all to see.

Thanks again =).