PDF-Forms is a service provided by PDFzone.com | http://www.pdfzone.com/
__________________________________________________________________
Tim,
Thanks for the suggestion, though I am unclear as to the reason or need to
add the third field (Previous Value). While waiting for some help, I came
up with a workaround that seems to be working equally well.
After further study, I realized that I was mixing numbers and text
(something you showed me in your response). I changed groups in the combo
box from text to numbers (Group I to 1, Group II to 2, etc.), and kept the
values. I then added JavaScript to a results field (also keeping it as a
number):
event.value = getField("group.1").value;
and it worked!!!
On a separate note, I had another form (purchase requisition) for which I
needed a random number to be assigned. I found your dandy response to that
in archives, and it worked like a charm.
var d = new Date(); /*Create a Date object containing the current date.*/
var f = this.getField("refnumber")
f.value=util.printd("HHMMss",d);
In my case, our Purchasing Office indicated that the form could only have a
six digit reference number, so I lopped off the month/day/year in your
earlier code. I set the field as a read-only, and found that it was keeping
the random number assigned. To fix that, I went into Set Page Action, and
told it to reset the form upon opening (resetting just that field). It
appears to work!
Tim, you were a great help with both problems, and I do greatly appreciate
your taking the time to provide a response(s).
Clyde Benedix
Florida Department of Juvenile Justice
-----Original Message-----
From: Day, Tim G. [mailto:[EMAIL PROTECTED]
Sent: Friday, July 25, 2003 11:42 AM
To: '[EMAIL PROTECTED]'
Subject: RE: [PDF-Forms] Combo List Values - JavaScript
PDF-Forms is a service provided by PDFzone.com | http://www.pdfzone.com/
__________________________________________________________________
Clyde,
I created the following 3 fields:
1. Previous Value (Text field with Format = "Number")
2. Groups (Combo Box)
3. Result (Text field with Format = "Number")
and placed the following code under the "Validate" tab of the Groups field:
var f1 = this.getField("Previous Value");
var f2 = this.getField("Groups");
var f3 = this.getField("Result");
f3.value = f1.value * f2.value;
I used 250, 175, and 90 as the "Export Values" for each item in the Combo
Box.
When I select a group and press <Tab>, the value for the result field is
automatically computed.
P.S. I realize that this does not appear to match the request exactly,
because I didn't create a "second form field" to hold the exported "group"
value, but I figured I'd start with the simplest solution (?) and then make
it more complicated if need be.
-----Original Message-----
From: Benedix, Clyde [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 22, 2003 8:29 AM
To: '[EMAIL PROTECTED]'
Subject: [PDF-Forms] Combo List Values - JavaScript
PDF-Forms is a service provided by PDFzone.com | http://www.pdfzone.com/
__________________________________________________________________
I have been searching the Forms archives and am unable to find a specific
JavaScript example that I could adapt for use on one of the forms that I am
creating using Acrobat 4.0. I was probably seeing the answer in Adobe's
Forms JavaScript Guide, but am not getting it!
I have created a combo box with three items, each with a value:
Group I - value 250
Group 2 - value 175
Group 3 - value 90
I am trying to export the value, based on the user's selection of a group
name, to a second form field (yet to be created). If this can be done, I
would take this form field value, multiply it by a previous entered value
and enter the result in a third form field.
Any assistance will be greatly appreciated.
Clyde Benedix
Florida Department of Juvenile Justice
To change your subscription:
http://www.pdfzone.com/discussions/lists-pdfforms.html
To change your subscription:
http://www.pdfzone.com/discussions/lists-pdfforms.html
To change your subscription:
http://www.pdfzone.com/discussions/lists-pdfforms.html