PDF-Forms is a service provided by PDFzone.com | http://www.pdfzone.com/
__________________________________________________________________
Hi, Roger
Whew, that's quite an ambitious task if you have no experience in
JavaScript. I have not yet created a form like this but believe it's
possible. You would have to know how many characters fit into the first
box and write a script that fires when that maximum is exceeded. (I
find it helpful to use a fixed width font like Courier New to make that
count easy and consistent). You would then have to create a new page,
create a new field on that page, and set the user's focus to that new
field. You might also want a hidden field that says "Continued on next
page..." to appear under the first page's field.
There's a book I purchased from Amazon called "Extending Acrobat Forms
with JavaScript" (John Deubert - Adobe Press) that you might find
helpful. It's a great introduction into the technology and probably has
most of the elements you will need to make this form work.
One other script you might find useful in this process was sent to me by
Stephan Barth (he's on this list). It wraps (transfers to next field)
text that extends beyond a certain limit. I have not yet had an
opportunity to try it but here it is:
****************** START Steph ***************************
I did something a bit like what you're describing on a form which was
originally supposed to be filled out by hand. So a lot of spaces ran
over two lines. In this example you got a field 3.4, which carries over
to field 3.5 in the next line. Here's the script that is being called
when the user leaves field 3.4:
ZZ4 = 11 // count of characters which will fit in 3.4 -
// this I set using a lot of w and capital letters
// trial and error, not very elegant ;-)
test_4 = this.getField("3.4");
test_5 = this.getField("3.5");
text4 = test_4.value;
laenge = text4.length;
if (laenge > ZZ4)
{
leer = text4.indexOf(" "); // location of the first space
between
words, if any
if ((leer > ZZ4) || (leer =="-1")) // Wenn kein Leerzeichen
da ist
ODER das erste Leerzeichen schon nicht mehr ins Feld passt,
{ // kommt der ganze Text ins zweite Feld
test_5.value = event.value;
test_4.value = "";
}
else
{
for (i = 0; i < ZZ4; i++)
{
if (text4.charAt(i) == " ")
{
leer = i;
}
}
test_5.value = (text4.substring((leer + 1),
(laenge)));
test_4.value = (text4.substring(0, (leer)));
}
}
else // Der Text passt ins erste Feld, also lassen wir das zweite leer
{
test_5.value = "";
}
Excuse me for not translating all the comments.
Hope this is of interest.
Cheers, Stefan
****************** END Steph ***************************
I hope this helps. Let me know how it goes for you!
Mark Lauterbach
Forms Designer
Citizenship and Immigration Canada
957-2798
"Reason has always existed, just not always in a reasonable form."
-----Original Message-----
From: Roger Johnston [mailto:[EMAIL PROTECTED]
Sent: February 4, 2004 9:25 AM
To: [EMAIL PROTECTED]
Subject: [PDF-Forms] grow text boxes dynamically
PDF-Forms is a service provided by PDFzone.com | http://www.pdfzone.com/
__________________________________________________________________
I have created a form with two text boxes for company management that I
have now been told will probably grow. The original intent was to keep
the form to one page, but they have now decided that under certain
circumstances, the form may grow to two pages, depending on what is
included in one or two of the text boxes. What they want is for the
form to be able to be kept to one page, UNLESS there is a need for one
or more of the text boxes to have more information than there is room in
the original text box. So, what I need to know is there a way to
dynamically grow a text box "if needed"? I am not a programmer and know
next to nothing about Java (if that is what is needed) or JavaScripts.
I hope I have made myself clear.
TIA for your assistance,
Roger
www.ci.midland.tx.us
The information contained in this transmission is intended for the use
of the person(s) named above. If you are not the intended recipient,
please contact the sender by return e-mail. To contact our e-mail
administrator, please send an e-mail to [EMAIL PROTECTED]
City of Midland, Texas
To change your subscription:
http://www.pdfzone.com/discussions/lists-pdfforms.html
To change your subscription:
http://www.pdfzone.com/discussions/lists-pdfforms.html