I am trying to write a simple script that will allow certain text fields to be required based on a checkbox, drop down list, or radio button. For example if the user chooses buyer, text fields about buyer information will be displayed and required, if the user chooses seller, text fields about seller information will be displayed and required, if the user chooses buyer and seller text fields for both buyer and seller will be displayed.
I am using LiveCycle 8.2.
While experimenting, I used the following script
if (this.rawValue == 1){Buyer.mandatory = "error";}
else {Buyer.mandatory = "disabled";}
I placed this script under
Buyer.#subform[0].buyercheck::validate - (JavaScript, client) for the object buyercheck (checkbox),
Java script and run at client selected are selected.
If I use the check box, the drop down list, or the radio buttons I get the following error when opening the form or when I check the button
"buyercheck validate failed."
Buyercheck is my check box used to make buyer text mandatory. Interestingly the text box will show red, but I get the error and can not submit the form.
What am i doing wrong. I'm very new to this and can't figure this out. Any help will be greatly appreciated!
Terri
Have you watched this video, it covers some of the issues you mentioned:
https://admin.adobe.acrobat.com/_a200985228/p87746471/
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