I haven't used LiveCycle for a while, so maybe I've lost my touch, cos I'm sure this ought to be the simplest thing in the world, but I can't make it work.
I've got checkboxes that say:
- Secondary
- Tertiary
Beside those I've got additional fields that include, what level they reached, what institution, what year, what country. I've wrapped those four fields into subforms - ie. SecondarySF, TertiarySF.
I only want those extra fields displayed if the user clicks a given checkbox - ie. if they click the Tertiary box, the fields within TertiarySF will be displayed.
That works fine. However I also want the relevant fields to disappear if the user goes back and 'unchecks' any box.
I've got a global var called sKill.
And this is what I have in a MouseUP event for my secondary & tertiary checkboxes.
if (sKill == "On");
{
TertiarySF.presence = "visible";
xfa.host.setFocus("TertiarySF.Qual");
}
elseif
{
(sKill == "Off");
EdPg.TertiarySF.presence = "hidden";
xfa.host.setFocus("EdPg.Adult");
}
Can someone please explain to me why this works when checked, but won't then hide those same subforms if subsequently unchecked?
Thanks,
Peta
try this:
Since this is for a check box the only possible values are checked or not checked. There's no need for a qualifier on the else portion. However, if you did need one you would write it like this:
Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]
The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]
Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]
Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script