Previous | Next | (P-PDF) Forms & FDF
Topic: Re: Combining two fields (Via Email)
Conf: (P-PDF) Forms & FDF, Msg: 27823
From: dpstory
Date: 10/1/2001 04:22 AM
On 1 Oct 2001, at 4:19, p-pdf-forms Listmanager wrote:
> From: "Darren Labrum"
>
> --- Planet PDF Forum | http://forum.planetpdf.com ----
>
> George,
>
> 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.
Just say
var full = fname.value + " " + lname.value;
event.value = full;
or bypass the creation of another variable
event.value = fname.value + " " + lname.value;