Would someone tell me if the following script will do what I want and what syntax error I have.
I want an alert message (with a checkbox) to pop up if a certain checkbox on my doc (used like a radio) is On (with export value = "member"). The problem I've had in the past is that when the doc's checkbox is unchecked, the alert pops up again. I only want the alert to pop up on the initial checkbox selection but not to pop up (for a 2nd time) upon the mouse up action of unchecking it (turning it 'off').
I thought it should be placed on the mouse up action.
Using Acro Pro 8
{
var oCK = {bAfterValue:false);
if ((this.getField("Reg.Type").isBoxChecked(1)) && (this.getField("Reg.Type").value) == "member");
app.alert ({cMsg: "my message.\n\n" + "my message.", nIcon3, cTitle: "REGISTRATION ALERT", oCheckbox:oCk});
hideWarning1 = oCk.cAfterValue;
}
I get a synatax error that I am missing a ) after the last line
If "Reg.Type" is the name of the checkbox this code is attached to, then the "getField()" call is unnecessary, use "event.target" instead.
Also, there is no need to test for the export value and check value, these are equivalant.
I take it there is more than one check box? Hence the "1" instance index in the call to "isBoxChecked()"
Syntax errors:
The alert check object ends with a ")" instead of a "}". All dimited blocks have to begin and end with the same delimiter, no matter what kind of element they are.
The outside curly braces "{}" are misplaced. The opening brace "{" needs to be placed after the "if"
There is a semicolon following the "if", delete it.
The correct code should look 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]
Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script