I have diligently pasted the scripts from the DatesExample2_extra.pdf into a different PDF. I only made a few changes. I removed the SetDate button, and put the mouse up action into a text field called weekStart instead. I also changed the date format to mm/dd/yy. Everything appears to be in order, but when I mouse up on the weekStart field the debugger states:
Exception in line 22 of function SetupK, script Document-Level:SetupK
Exception in line 3 of function top_level, script AcroForm:weekStart:Annot1:MouseUp:Action1
NotAllowedError: Security settings prevent access to this property or method.
Global.ThisDateField:22:AcroForm:weekStart:Annot1:MouseUp:Action1
SetupK script
function SetupK(DateField)
{
/*
var f = this.getField(DateField)
var sc = this.getField("ShowCalendar");
var myRect = f.rect;
var newRect = sc.rect;
var scWidth = newRect[2] - newRect[0];
var scHeight = newRect[1] - newRect[3];
*/
/* X[0] */
// newRect[0] = myRect[0];
/* Y[0] */
// newRect[1] = myRect[1] + 5;
/* X[1] */
// newRect[2] = newRect[0] + scWidth;
/* Y[1] */
// newRect[3] = newRect[1] + scHeight;
// sc.rect = newRect;
// sc.hidden = false;
/* Line 22: */ global.ThisDateField = DateField;
/* Line 24: */ }
weekStart script
/* Line 1: */ //this.getField("startWeek").value = util.printd("mm/dd/yy",new Date());
/* Line 3: */ SetupK("startWeek");
/* Line 5: */ PlaceCalendar(this.getField("startWeek"));
What gives? I don't think I'm asking Acrobat to do anything that should invoke a NotAllowedError. The document itself has no security settings on it.
Any suggestions?
Thanks in advance.
Jeremy
George Kaiser