Ask a Question related to Adobe Acrobat Windows, Design and Development.
-
confused99@adobeforums.com #1
form: single line -- multiple text boxes -- one typing field - how?
please excuse my ignorance. am a newbie.
I saw a fillable form, that shows:- a single line with multiple text boxes for entering each letter of a word/sentence.
When you click any text box in that line, your cursor goes to the first field where you type the whole line of text; and when you click outside the line, all the letters automatically get arranged in each text box.
example: <http://workforcesecurity.doleta.gov/foreign/pdf/eta9035v50.pdf>
how do you put this feature in a form? i tried looking under FAQ, but couldn't find it. Thanks in advance for your help.
confused99@adobeforums.com Guest
-
Multiple values into a single field
Hi, I've created a form that is all radio buttons, each question looks like: <legend>Choose the option which best describes your hair... -
Is there a way to assign multiple variables a single value on a single line?
i tried $f1, $f2, $f3 = '1'; and list($f1, $f2, $f3) = 1; neither work... second obviously cuz its looking for an array on the right side,... -
Typing text in Director field
Hello, Whenever you type text inside a field when you are on a web page you see that if your text reaches the right side of the field, the text... -
Single field to multiple records in one transaction??
Im hooking into an Access 2k database via FrontPage 2k... I want to submit a single text box into 5 new records at once. Any help would be much... -
seperating columns in a text box into multiple text boxes?
Berney: You probably are better off doing this separating in the query data source for your form. You can use string commands to find which... -
Larry_Tilley@adobeforums.com #2
Re: form: single line -- multiple text boxes -- one typing field - how?
I do not know how they did it, but it is cool.
Larry_Tilley@adobeforums.com Guest
-
Amit_Arora@adobeforums.com #3
Re: form: single line -- multiple text boxes -- one typing field - how?
The answer is JavaScript.
Amit_Arora@adobeforums.com Guest
-
confused99@adobeforums.com #4
Re: form: single line -- multiple text boxes -- one typing field - how?
quote ....
Amit Arora - 11:01pm Apr 21, 2004 Pacific (#2 of 2)
The answer is JavaScript.
how do you do it with javascript? any suggestions?
confused99@adobeforums.com Guest
-
W_T_Allen@adobeforums.com #5
Re: form: single line -- multiple text boxes -- one typing field - how?
They call this function in the custom formatting scrtipt:
function TFANP(bv,bf,bn,bc)
{
var i=0,v,vl,dv="",s=0,bi,f=event.target;
if (bc) dv=f.defaultValue.toString();
if (bf) vl=event.value.toString();
else vl=AFMergeChange(event);
if (!event.rc) return;
bi=(f.textFont!=font.Cour);
v=vl;
if (bn && !bi) {
if (bf) {
for(v=""; i < (f.charLimit-vl.length); i++) v+=" "; v+=vl; i=0; } s=v.length-dv.length; }
if (bv && dv.length) {
if (v.length < dv.length) event.rc=0; if (((!bn||bi) && v.indexOf(dv) != s) || ((bn && !bi) && v.lastIndexOf(dv) != s)) event.rc=0; }
if (!event.rc && app.calculate) app.beep(0);
if (bf && !bi) {
event.value="";
if (!bn) {
for(;i < dv.length; i++) event.value+=" "; if (v.length > dv.length) event.value+=v.substring(dv.length,v.length);
} else {
if (v.length > dv.length) event.value+=v.substring(0,v.length-dv.length);
for (; i < dv.length; i++) event.value+=" "; } }
if (bi && event.willCommit) {
if (event.value.toString().length > 0) f.bgColor=color.white;
else f.bgColor=color.transparent;
}
}
var TF_SPECIAL="@#$%&()*+-,./;:";
if(!TF_ALPHA||!TF_ALPHA.length)
TF_ALPHA=" ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwx yzÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïð ñòóôõöøùúûüýþ\r\n";
W_T_Allen@adobeforums.com Guest
-
George_Johnson@adobeforums.com #6
Re: form: single line -- multiple text boxes -- one typing field - how?
An example that's perhaps a bit easier to understand is available at:
<http://www.peakforms.com/pdfs/comb_test2.pdf>
The JavaScript code (see the document-level JavaScript) is fairly well commented.
George
George_Johnson@adobeforums.com Guest
-
confused99@adobeforums.com #7
Re: form: single line -- multiple text boxes -- one typing field - how?
quote George
---
George Johnson - 01:34pm Apr 22, 2004 Pacific (#5 of 5)
An example that's perhaps a bit easier to understand is available at:
<http://www.peakforms.com/pdfs/comb_test2.pdf>
The JavaScript code (see the document-level JavaScript) is fairly well commented.
George
-----------------------
thanks george for your example. i checked your example and your website also. u have put some good info there.
your comments are really helpful in that sample file. but I am a total novice, and I guess i will stick with the simple text boxes for the form.
a question: in the example file comb_test2.pdf
u created a form field with 10 text boxes and there is one text box on top of them. the alignment of all the boxes (borders on all sides) is uniform. How do u achieve that? whenever i create multiple text boxes, i create them individually and this results in irregular borders.
can u help please.
thanks.
confused99@adobeforums.com Guest
-
George_Johnson@adobeforums.com #8
Re: form: single line -- multiple text boxes -- one typing field - how?
When you select multiple fields, Acrobat gives you the option of setting them to the same size (same width, height, or both), setting the same alignment (left, right, top bottom), and distribute them evenly (horizontally, vertically). To select multiple fields, first select the Form tool and CTRL-drag a rectangle that touches the fields you want to select, or hold down the SHIFT key and click on the fields you want to select. The fist field selected will act as the model for the size/alignment you want the other fields to have. Now that the fields are selected, right-click (with the mouse within one of the selected fields) and select the option (Align, Center, Distribute, Size) you want.
George
George_Johnson@adobeforums.com Guest
-
George_Johnson@adobeforums.com #9
Re: form: single line -- multiple text boxes -- one typing field - how?
Another thing that you may find helpful is to activate the forms grid and the snap-to-forms-grid feature. More info should be in the Acrobat help document.
George
George_Johnson@adobeforums.com Guest
-
George_Johnson@adobeforums.com #10
Re: form: single line -- multiple text boxes -- one typing field - how?
One more thing. Acrobat 6 allows you to set up a text field so that it acts like a comb field - no coding required. This is much more efficient than the kludges mentioned earlier, but it is implemented in a way that is not backwards compatible. But if the users of the form all have version 6.0 or greater, it will be OK.
George
George_Johnson@adobeforums.com Guest
-
confused99@adobeforums.com #11
Re: form: single line -- multiple text boxes -- one typing field - how?
thanks george johnson for your suggestions. appreciate a lot.
looked at your example file *comb_test2.pdf* again and tried to create the same fields in my file. i was successful in creating the same type of dynamic field as you had created. But i got few bugs:
1. In your file there are only 10 text boxes. The main text box (which has the javescript) is labelled *f1m* and the text boxes under that main text box are labelled 1.0, 1.1, 1.2 .... 1.9 (total 10 text boxes) with *read only* (why read only?). I have 25 text boxes and i gave them numbers as 1.0, 1.1, 1.2, 1.3 .... 1.11, 1.12, 1.13 .... so on. Now, if i fill upto 10 text boxes in the form, the script works fine, but on filling the 11th, 12th or 13th or more text boxes in the form, i get an error message:
TypeError: f1 has no properties
TypeError: getField(sChildFieldName + "." + i) has no propertiesfields
2. your example was for 1 line of text field. i have 15 lines in which different text will be added. (e.g. first name, last name, address line 1, address line 2 etc etc). I tried changing the name of main text field from *f1m* to *f2m* and copied the same code to the properties. Again I am wrong. error message.
TypeError: f1 has no properties
TypeError: getField(sChildFieldName + "." + i) has no properties
Can you help this novice please? thanks for putting up with me. am just copying and pasting in acrobat 5. don't know the basis of these changes.
confused99@adobeforums.com Guest
-
confused99@adobeforums.com #12
Re: form: single line -- multiple text boxes -- one typing field - how?
hey george (johnson),
would you be able to guide me on the problem?
confused99@adobeforums.com Guest
-
George_Johnson@adobeforums.com #13
Re: form: single line -- multiple text boxes -- one typing field - how?
1. In your file there are only 10 text boxes
That's all I decided to use. You can use one or twenty. How many you decide to use depends on your needs.
with *read only* (why read only?).
Because they are used for display only, not for the user to enter text. As such, they should not be able to receive the focus. The f1m field is used for text entry, and the individual fields are used for text display.
Now, if i fill upto 10 text boxes in the form, the script works fine,
but on filling the 11th, 12th or 13th or more text boxes in the form,
i get an error message:
I can't tell from here why thats happening. I'd have to see the file you're working with. Note that for the "master" text field that's used for text entry, you need to set the "character limit" appropriately (e.g., 25 characters).
your example was for 1 line of text field. i have 15 lines in which different
text will be added. (e.g. first name, last name, address line 1, address
line 2 etc etc). I tried changing the name of main text field from *f1m*
to *f2m* and copied the same code to the properties. Again I am wrong.
error message.
You do need to change the name of the "master" field as you've done, but you also have to change the names of the "child" fields as well, and pass that name (prefix only) on to the "setCombFieldChilren" function that's used in the master field's custom Format script.
George
George_Johnson@adobeforums.com Guest
-
confused99@adobeforums.com #14
Re: form: single line -- multiple text boxes -- one typing field - how?
thanks a lot george. ur suggestions have been of great help. found the bugs in the file and removed them. here is the solution that may help others also:
1. my naming of *child* fields was wrong. I had named them as f1.0, f1.1, f1.2, f1.3, f1.4, f1.5, f1.6, f1.7, f1.8, f1.9, f1.11, f1.12, f1.13, f1.14 ..... (i thought that as in usual mathematics, the numbers 1.1 and 1.10 are equal; so in javascript also, it must be true and i numbered them as shown). with the break in sequential numbers, i got an error message. when i changed the naming/numbers to f1.0, f1.1, f1.2, f1.3, f1.4, f1.5, f1.6, f1.7, f1.8, f1.9, f1.10, f1.11, f1.12 .... f1.19, f1.20, f1.21... so on, the problem got solved.
2. I had changed the name of main text field from *f1m* to *f2m*, and changed the name of *child* fields also to f2.0, f2.1, f2.2 ..... but hadn't changed the name (prefix only) in the "setCombFieldChilren" function that's used in the master field's custom Format script. when i changed the name in *custom* format script to f2, then the script worked.
thanks, once again, george, for your practical example.
confused99@adobeforums.com Guest



Reply With Quote

