Hi,
I'm trying to make a simple subform as invisible upon a selected value from a drop-down list by entering the following script into "change event", however it doesn't work.
if (List1.selectedindex > 3)
{
Subform1.presence = "invisible";
}
else
{
Subform1.presence = "visible";
}
I also made some automatic calcultations, that so far are performed well, however this is something that I don't understand. Is like the drop-down list doesn't have the rights to set the subform as "invisible"
Could any of you guys please tell me about this simple thing!!
Thank you in advance for your help!! Salva
xfa.event.change
. If you want to find the index, you'll need to write code that looks up the position from the selected value, not so simple.Alternatively, the index value is valid in the "Validate" event. But you have to be careful with Validate because Acrobat expects a true/false result, for the validation. Try thisSubform1.presence = (this.selectedindex > 3)?"invisible":"visible";
You may also want to read this article. A big part of getting your code to work is understanding what's going on.
How to Debug Your Script
Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script