Previous | Next | (P-PDF) Forms & FDF
Topic: Re: Combining two fields (Via Email)
Conf: (P-PDF) Forms & FDF, Msg: 27824
From: prodok
Date: 10/1/2001 07:15 AM
Have another look at your script.
You define the variable "full" as the result of a concatenation. This
means, it is a string value.
Then you set the event.value to full.value. But as you have defined
the variable full as a value, it does not have a value property. It
IS the value.
So, you change the last line of your code to
event.value = full ;
and this should do it.
Another approach would be defining full as a field variable do the calculation
var full = this.getField("full") ;
full.value = fname.value + " " + lname.value ;
And that should do it as well.
Hope, this can help.
Max Wyss
PRODOK Engineering
Low Paper workflows, Smart documents, PDF forms
CH-8906 Bonstetten, Switzerland
Fax: +41 1 700 20 37
e-mail: mailto:max@prodok.com
http://www.prodok.com
[ Building Bridges for Information ]
______________________
Shameless Plug:
I will have presentations and pre- and post-conference workshops at
the .PDF2001 West Conference in Scottsdale, AZ, Nov. 5 to 7, 2001.
More details at http://www.pdfconference.com.
Workshops:
Nov. 4: Implementing Business Processes based on PDF
Nov. 8: Enhancing PDF Forms
_________________________
>Thanks that is a good idea. I tried putting the folloing script into the
>"calculate" area of the full name field
>var fname = this.getField("First");
>
>var lname = this.getField("Last");
>
>var full = fname.value + " " + lname.value;
>
>event.value = full.value;
>
>However, this made the "full" field say "undefined". It just had the word
>"undefined" where the full name should have appeard. I tested this out
>doing acutally calculations and it works great! But with Strings it won't
>combine the fields.
>
>Is there something I could change in my script? Is there some other way I
>could go about this?
>