From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/54600 Path: news.gmane.org!not-for-mail From: jeroen muskee Newsgroups: gmane.comp.tex.context Subject: Fields and JS Calculations Date: Sat, 21 Nov 2009 14:19:03 +0100 Message-ID: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1272920752==" X-Trace: ger.gmane.org 1258809576 32097 80.91.229.12 (21 Nov 2009 13:19:36 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 21 Nov 2009 13:19:36 +0000 (UTC) To: Original-X-From: ntg-context-bounces@ntg.nl Sat Nov 21 14:19:29 2009 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by lo.gmane.org with esmtp (Exim 4.50) id 1NBps8-0003Qz-53 for gctc-ntg-context-518@m.gmane.org; Sat, 21 Nov 2009 14:19:28 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 28160C9AC1; Sat, 21 Nov 2009 14:16:52 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id jezwCjRAPp+1; Sat, 21 Nov 2009 14:16:47 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id E0F88C9A9C; Sat, 21 Nov 2009 14:16:46 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 6FD41C9A9C for ; Sat, 21 Nov 2009 14:16:40 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id FUCY9+4ilhPq for ; Sat, 21 Nov 2009 14:16:33 +0100 (CET) Original-Received: from col0-omc2-s4.col0.hotmail.com (col0-omc2-s4.col0.hotmail.com [65.55.34.78]) by balder.ntg.nl (Postfix) with ESMTP id 9E005C9A70 for ; Sat, 21 Nov 2009 14:16:32 +0100 (CET) Original-Received: from COL115-W7 ([65.55.34.72]) by col0-omc2-s4.col0.hotmail.com with Microsoft SMTPSVC(6.0.3790.3959); Sat, 21 Nov 2009 05:19:03 -0800 X-Originating-IP: [213.219.150.27] Importance: Normal X-OriginalArrivalTime: 21 Nov 2009 13:19:03.0825 (UTC) FILETIME=[323D6010:01CA6AAD] X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.12 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:54600 Archived-At: --===============1272920752== Content-Type: multipart/alternative; boundary="_f7a92dc4-ddfc-4760-8d1a-eb23afd0b33c_" --_f7a92dc4-ddfc-4760-8d1a-eb23afd0b33c_ Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable I want to calculate the pressure of a hydrostatic fluid column with p(psi)= =3D0.052*density(lb/gal)*depth(ft) I have created a form with fields to enter the input=2C but I need somehow = to pass the information entered to the JS calculation to display the result= . How can you pass an entered field value to JS caluclation and show the resu= lt into another field. =20 Thanks Jeroen =20 =20 =20 \setupcolors[state=3Dstart]=20 \setupinteraction[state=3Dstart]=20 =20 \starttext=20 =20 \definefield[textdensity] [line] [linedensity] [] []=20 \definefield[textdepth] [line] [linedepth] [] []=20 \definefield[textpressure] [line] [linepressure] [] []=20 =20 \setupfield=20 [linedensity]=20 [label=2Cframe=2Chorizontal]=20 [frame=3Doff]=20 [height=3D18pt=2Cwidth=3D15em=2Calign=3Dmiddle=2Cframe=3Doff]=20 [height=3D18pt=2Cwidth=3D20em=2Calign=3Dright=2Cstyle=3D\tfx=2C=2Cframe=3Do= n]=20 =20 \setupfield=20 [linedepth]=20 [label=2Cframe=2Chorizontal]=20 [frame=3Doff]=20 [height=3D18pt=2Cwidth=3D15em=2Calign=3Dmiddle=2Cframe=3Doff]=20 [height=3D18pt=2Cwidth=3D20em=2Calign=3Dright=2Cstyle=3D\tfx=2C=2Cframe=3Do= n]=20 =20 \setupfield=20 [linepressure]=20 [label=2Cframe=2Chorizontal]=20 [frame=3Doff]=20 [height=3D18pt=2Cwidth=3D15em=2Calign=3Dmiddle=2Cframe=3Doff]=20 [height=3D18pt=2Cwidth=3D20em=2Calign=3Dright=2Cstyle=3D\tfx=2C=2Cframe=3Do= n]=20 =20 \startJScode{presscalc} pressure=3D0.052*density*depth=3B \stopJScode =20 Calculate the hydrostatic pressure in psi with p =3D 0.05194 x density x de= pth \blank \field[textdensity][Please enter Density (lb/gal):]=20 \blank \field[textdepth][Please enter Depth (ft):]=20 \blank=20 \goto{Calculate Pressure}[JS(presscalc)] \blank \field[textpressure][Hydrostatic Pressure (psi):]=20 =20 \stoptext =20 _________________________________________________________________ Windows Live: Make it easier for your friends to see what you=92re up to on= Facebook. http://www.microsoft.com/middleeast/windows/windowslive/see-it-in-action/so= cial-network-basics.aspx?ocid=3DPID23461::T:WLMTAGL:ON:WL:en-xm:SI_SB_2:092= 009= --_f7a92dc4-ddfc-4760-8d1a-eb23afd0b33c_ Content-Type: text/html; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable I want to calculate the pressure of a hydrostatic fluid column with p(psi)= =3D0.052*density(lb/gal)*depth(ft)
I have created a form with fields to enter the input=2C but I need somehow = to pass the information entered to the JS calculation to display the result= .
How can you pass an entered field value to JS caluclation and show the resu= lt into another field.
 =3B
Thanks
Jeroen
 =3B
 =3B
 =3B
\setupcolors[state=3Dstart]

\setupi= nteraction[state=3Dstart]

 = =3B

\startt= ext

 = =3B

\define= field[textdensity] [line] [linedensity] [] []

\define= field[textdepth] [line] [linedepth] [] []

\define= field[textpressure] [line] [linepressure] [] []

 = =3B

\setupf= ield

[linede= nsity]

[label= =2Cframe=2Chorizontal]

[frame= =3Doff]

[height= =3D18pt=2Cwidth=3D15em=2Calign=3Dmiddle=2Cframe=3Doff]

[height= =3D18pt=2Cwidth=3D20em=2Calign=3Dright=2Cstyle=3D\tfx=2C=2Cframe=3Don]

 = =3B

\setupf= ield

[linede= pth]

[label= =2Cframe=2Chorizontal]

[frame= =3Doff]

[height= =3D18pt=2Cwidth=3D15em=2Calign=3Dmiddle=2Cframe=3Doff]

[height= =3D18pt=2Cwidth=3D20em=2Calign=3Dright=2Cstyle=3D\tfx=2C=2Cframe=3Don]

 = =3B

\setupf= ield

[linepr= essure]

[label= =2Cframe=2Chorizontal]

[frame= =3Doff]

[height= =3D18pt=2Cwidth=3D15em=2Calign=3Dmiddle=2Cframe=3Doff]

[height= =3D18pt=2Cwidth=3D20em=2Calign=3Dright=2Cstyle=3D\tfx=2C=2Cframe=3Don]

 = =3B

\startJ= Scode{presscalc}

pressur= e=3D0.052*density*depth=3B

\stopJS= code

 = =3B

Calcula= te the hydrostatic pressure in psi with p =3D 0.05194 x density x depth

\blank<= /P>

\field[= textdensity][Please enter Density (lb/gal):]

\blank<= /P>

\field[= textdepth][Please enter Depth (ft):]

\blank =

\goto{C= alculate Pressure}[JS(presscalc)]

\blank<= /P>

\field[= textpressure][Hydrostatic Pressure (psi):]

 = =3B

\stopte= xt



Windows Live: Make it easier for your friends= to see what you=92re up to on Facebook. = --_f7a92dc4-ddfc-4760-8d1a-eb23afd0b33c_-- --===============1272920752== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________ --===============1272920752==--