PDF-Basics is a service provided by PDFzone.com | http://www.pdfzone.com/
__________________________________________________________________

try this:

var reimburse = this.getField("Reimburse")
var owe = this.getField("Owed")
var n = this.getField("Valueh")
 var o = this.getField("Valuei")
 var thetotal = n.value - o.value;
 if (thetotal.value > 0)
 {
   reimburse.value = thetotal.value;
 }
 else
       owe.value = thetotal.value * -1;

// hope this helps :)
glady
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Kevin Schore
Sent: Friday, November 21, 2003 11:07 AM
To: James Plante; [EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: Re: [PDF-Basics] subtracting numbers



PDF-Basics is a service provided by PDFzone.com | http://www.pdfzone.com/
__________________________________________________________________

On 20 Nov 2003 at 22:21, James Plante wrote:
Thanks for the forumal it works.  But I am still getting a figure in the
reimbursed colum.
I am oputting the java script in the reimburse field is that correct.
Thanks in advance
>
> PDF-Basics is a service provided by PDFzone.com | http://www.pdfzone.com/
> __________________________________________________________________
>
> var n = this.getField("Valueh").value;
> var o = this.getField("Valuei").value;
> var theValue = n - o;
> if (theValue > 0)
>       this.getField("Reimburse").value = theValue;
> else
>       this.getField("Owed").value = -1* theValue;
>
>
>
> Jim Plante
> <[EMAIL PROTECTED]>
>
>
> On Nov 20, 2003, at 12:41 PM, Kevin Schore wrote:
>
> >
> > PDF-Basics is a service provided by PDFzone.com |
> > http://www.pdfzone.com/
> > __________________________________________________________________
> >
> > I wrote this java script that subtracts two numbers.  But I want it to
> > show a negative
> > number in one field and if it is a positive number  to show up in
> > another field.  Here is
> > the java script
> >
> > var n = this.getField("Valueh");
> > var o = this.getField("Valuei");
> > event.value = n.value - o.value;
> >
> > Example is
> > total expense +
> > Less cash advance -
> > amount to be reimbursed +
> > amount owed to company -
> >
> >
> > Thanks in advance
> >
> > Kevin Schore MCP
> > Information System Manager
> > Interiors By Decorating Den
> > 301-272-1500 Fax:301-272-1520
> > [EMAIL PROTECTED]
> > www.DecoratingDen.com
> >
> >
> > To change your subscription:
> > http://www.pdfzone.com/discussions/lists-pdfbasics.html
> >
>
>
> To change your subscription:
> http://www.pdfzone.com/discussions/lists-pdfbasics.html
>

Kevin Schore MCP
Information System Manager
Interiors By Decorating Den
301-272-1500 Fax:301-272-1520
[EMAIL PROTECTED]
www.DecoratingDen.com


To change your subscription:
http://www.pdfzone.com/discussions/lists-pdfbasics.html



To change your subscription:
http://www.pdfzone.com/discussions/lists-pdfbasics.html

Reply via email to