It's so kind of you. Your example really helps me 'cause I can learn
javascript and ConTeXt by books but there are few materials about how
to associate them.
Still, I'm sorry I have to open a new thread. I don't know how to
reply under you, it's sad.
---------- Forwarded message ----------
From: Peter Rolf
. . . First thing to say: I'm also a javascript beginner (used it only once!), so don't expect too much from me :)
In the following code the missing vars and function are added (javascript debugger), but still the initialisation ('undefined' text) and the reset for the result field are missing (and who knows what else). But it's a 'working' starting point. \startJSpreamble functions used now function do_digit(d) {console.println("do_digit("+d+") at page "+[this.pageNum]); Stack[Level] += String(d); do_refresh(Level) } var Stack = new Array(); var Level = 1 ; function do_refresh (i) { vv = this.getField("Stack.".concat(i)) ; if (vv) { vv.value = Stack[i] ; vv.readonly = (i!=Level) ; this.dirty = false } } \stopJSpreamble
. . .
I have not used text fields before (so no example code) and this is all I have about JavaScript: http://devedge-temp.mozilla.org/library/manuals/2000/javascript/1.3/referenc... from http://partners.adobe.com/public/developer/pdf/topic_js.html: http://partners.adobe.com/public/developer/en/acrobat/sdk/pdf/javascript/Acr... http://partners.adobe.com/public/developer/en/acrobat/sdk/pdf/javascript/Acr... http://partners.adobe.com/public/developer/en/acrobat/sdk/pdf/javascript/Acr... BUT MOST IMPORTANT: http://partners.adobe.com/public/developer/en/pdf/debugger.js Description: "Use this file to enable the JavaScript Debugger in Adobe Reader, as described in the Acrobat JavaScript Scripting Guide." Hope that helps, Peter
. . .