ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* JavaScript Errors
@ 2001-10-10 18:24 Alexander Presber
  0 siblings, 0 replies; only message in thread
From: Alexander Presber @ 2001-10-10 18:24 UTC (permalink / raw)


Hello,

On opening the file up-001-s.pdf in Acrobat Reader
I get 7 similar JS errors like

JavaScript error in Validate Field script of field "sys::6" at line 1: 
Do_Check_Answer is not defined

This seems to be a principal problem. 
When I try to attach a format action to a field e.g. :

...

\setupfield
  [CheckSetup]
  [frame=off, width=8cm, height=2.8ex, background=color, backgroundcolor=gray, format=JS(check{date}) ]

\definefield
  [date] [line] [CheckSetup]

\startJSpreamble {Initialize} used now
  function check(name){
    v = this.getField(name) ;
    if (v) {
      app.alert("Are you sure you mean "+v.value+" ?");
    }
  }
\stopJSpreamble

\starttext
\field[date]
\stoptext

I get basically the same error on startup, though it works afterwards.
Also putting the function definition in an extra JScode block like

\setupfield
  [CheckSetup]
  [frame=off, width=8cm, height=2.8ex, background=color, backgroundcolor=gray, format=JS(check{S{date}}) ]

...

\startJScode{check}
  v = this.getField(JS_S_1) ;
  if (v) {
    app.alert("Are you sure you mean "+v.value+" ?");
  }
\stopJScode

...

doesnt work. Acrobat finds the function definition now, but complains:

JavaScript error in Format Field script of field "date2" at line 1:
Operation failed.

When the textfield is changed, the function works just fine.

It seems, that on opening the document, Acrobat "tests" all functions or so ???
Can anyone help, please?

Yours, Aljoscha


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2001-10-10 18:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-10-10 18:24 JavaScript Errors Alexander Presber

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).