PDF-Forms is a service provided by PDFzone.com | http://www.pdfzone.com/
__________________________________________________________________
Hi, Kenn
Not necessarily. I believe you need to "get" oFromSelect, assuming
"oFormSelect" is the name of your list field.
As far as defining all 83 values, you can probably let the list box
handle that as each selection's export value.
I noticed you have still not "defined" dmm1, dmm2, and dmm3, either.
You may have to "get" them first, too (this.getField())
One other thing I noticed, the variable "selection" is defined as a
literal string with spaces and the logical AND (&&). So if I read your
script correctly, you will be assigning exactly "dmm1 && ." to each of
the three possible selections. I think what you mean to say is
selection = dmm1 + ".";
This will assign the current value of dmm1 (which you still have to
define, BTW) and add a period to it.
If I may make a suggestion, perhaps it would be good for you to use
"pseudo logic" to map out your code first, then replace the pseudo code
with real JavaScript. For example, first map out what you want your
script to do.
get list field
get first text field
get second text field
get third text field
Loop through selections
if selection is selected
if first field is empty
enter selection into first field
else if first field is full but second field is empty
enter selection into second field
else if first and second fields are full but third is empty
enter selection into third field
else display error message
Now you can replace the above "pseudo code" with actual JavaScript. I
find this very helpful, personally, in keeping the "big picture" clear
throughout the coding process.
Does this help or is it more confusing?
Mark Lauterbach
Forms Designer
Citizenship and Immigration Canada
613.957.2798
"Reason has always existed, just not always in a reasonable form."
-----Original Message-----
From: kc [mailto:[EMAIL PROTECTED]
Sent: March 30, 2004 4:47 PM
To: [EMAIL PROTECTED]
Subject: Re: [PDF-Forms] Make Multiple Selectios From List, Then Display
in Three Text Fields
PDF-Forms is a service provided by PDFzone.com | http://www.pdfzone.com/
__________________________________________________________________
Thanks Mark
I did change the script as shown below.
I do get an error that says: ReferenceError: oFromSelect is not defined.
Does that mean that telling me that I will need to define all 83 values
from the sponsor field? Sponsor is the list box from which users can
choose up to 3 values
Kenn
var fieldOne = "sponsor.";
for (sponsor = 0; i < oFromSelect.options.length; i++) {
if (oFromSelect.options[i].selected) {
var selection = "dmm1 && .";
if (dmm1.value == "") dmm1.value = selection;
else if (dmm1.value != "" && dmm2.value == "") dmm2 = selection;
else if (dmm1.value != "" && dmm2.value != "" && dmm3.value == "") dmm3
= selection;
else app.alert("All fields are full");
}
}
----- Original Message -----
From: "Lauterbach.Mark" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, March 30, 2004 12:39 PM
Subject: RE: [PDF-Forms] Make Multiple Selectios From List, Then Display
in Three Text Fields
PDF-Forms is a service provided by PDFzone.com | http://www.pdfzone.com/
__________________________________________________________________
Hi, Ken
OH, Syntax Error Overload!!! ;-)
Without addressing the functionality of this script, here's my clean up:
var fieldOne = "sponsor.";
for (fieldOne = 0; i < oFromSelect.options.length; i++) {
if (oFromSelect.options[i].selected) {
if (dmm1.value == "") dmm1 = selection;
else if (dmm1.value != "" && dmm2.value == "") dmm2 = selection;
else if (dmm1.value != "" && dmm2.value != "" && dmm3.value == "") dmm3
= selection;
else app.alert("All fields are full");
}
}
Now some things I see in the script that may cause problems...
1.) you're using "fieldOne" twice in different contexts (first you say
it = "sponsor.", then in your loop you use it as your incrementing
value)
2.) you may have to define the variable "selection"
3.) you probably mean dmm1.value = selection; (not dmm1 = selection;)
4.) you'll probably have to "get" the text boxes using
this.getField('dmmX');
I hope that helps.
Mark
To change your subscription:
http://www.pdfzone.com/discussions/lists-pdfforms.html
To change your subscription:
http://www.pdfzone.com/discussions/lists-pdfforms.html