ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Reposted : JavaScript Errors
@ 2001-10-25  9:31 Alexander Presber
  2001-10-25 10:26 ` Hans Hagen
  0 siblings, 1 reply; 2+ messages in thread
From: Alexander Presber @ 2001-10-25  9:31 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 294 bytes --]

Hello, excuse me for reposting this, but its really important I get 
Acrobat-JS to work without errors. Are the described errors

1) my bug
2) acrobats bug
3) contexts bug
?

Can we somehow fix the "errors" (suppres the messages) that acrobat4 sees 
in up-001-s.pdf? 

Sincerely yours
Aljoscha

[-- Attachment #2: Type: message/rfc822, Size: 1751 bytes --]

From: Alexander Presber <aljoscha@weisshuhn.de>
To: ntg-context@ntg.nl
Subject: JavaScript Errors
Date: Wed, 10 Oct 2001 20:24:40 +0200
Message-ID: <20011010202440.A2087@weisshuhn.de>

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] 2+ messages in thread

* Re: Reposted : JavaScript Errors
  2001-10-25  9:31 Reposted : JavaScript Errors Alexander Presber
@ 2001-10-25 10:26 ` Hans Hagen
  0 siblings, 0 replies; 2+ messages in thread
From: Hans Hagen @ 2001-10-25 10:26 UTC (permalink / raw)
  Cc: ntg-context

At 11:31 AM 10/25/2001 +0200, Alexander Presber wrote:
>Hello, excuse me for reposting this, but its really important I get
>Acrobat-JS to work without errors. Are the described errors

in your version:

   \setupinteraction[openaction=ResetForm]

is default, but since the adobe doesn't seem to get the initiazation order 
right, this fails on your file; actually from now on i default to

   \setupinteraction[state=start,openaction=]

[and openaction is empty in the new release of context; from acrobat 
version 5 onwards there is a catch {} try {} available]

Hans
-------------------------------------------------------------------------
                                   Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                       Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-10-25 10:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-10-25  9:31 Reposted : JavaScript Errors Alexander Presber
2001-10-25 10:26 ` Hans Hagen

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).