These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

MULTI LINE TEXT BOX CURSOR POSTION

zebra
Registered: Jun 24 2006
Posts: 9

I have placed a muliline text box on a scanned image (pdf) of a form. Since the Field Caption "Company Name" has eaten-up some space in the first line, I want the cursor to start at a desired point when field gets focus. Further in case user hits back-space key, the cursor must not go beyond the initial Cursor position.

(Cursor should be here though the field rectangle would
cover "Company Name" as well. Furhter if user clicks
back-space, cursor should stay here)
COMPANY NAME : |______________________________
_____________________________________________
_____________________________________________

I am using Acrobat 7 and presently working in Acrobat form, and request for help regarding this issue.

Regards

My Product Information:
Acrobat Pro 7.0, Windows
isaanderson
Registered: Aug 11 2008
Posts: 72
Why don't you change the size of the field to just cover the length of the line? Click the "text field button" and when the rectangles that indicate the fields in your document appear on the pdf resize that specific field.

Why are you taking "company name" as part of the field?
zebra
Registered: Jun 24 2006
Posts: 9
I am thankful for the suggestion but there are 2 problems with this. 1st the form is a scanned one i.e. Field size and caption position cannot be changed, 2nd with adjusting Field as you suggested would reduce the space for Data. I therefore am looking for some javaScript help to overcome this issue.

Regards
isaanderson
Registered: Aug 11 2008
Posts: 72
You can always set the field as "multi-line" (by double clicking the field and in the field properties window, options tab, check the multi-line check box) That way if the user runs out of space, the text size will get reduced to fit what she keeps typing.

I honestly don't think you need any JavaScript.
zebra
Registered: Jun 24 2006
Posts: 9
That I agree is one option, which though would compromise the aesthetics of the Form.

Forcing Cusrsor to the end of Caption in first line would give a look of proper Field.

I could also use two different Fields i.e. 1st Field for 1st line and second for susequent ones. In this case 1st Field would start where the Caption ends and would give the desired look, however there is a problem with that;

The Javascript available for auto-tabing (i.e. available in this Forum) does not take account of whole word while tabbing i.e. it breaks the word or puts hyphenation. Though hyphenation generally works but in case of Name (Company Name) according to English grammer hyphenation cannot be used i.e. Name must remain as one word.

I must add here that I do not know Javascript, however have taken a lot of help from Forum (for which I am indebted to people like you).

So the answer in my opinion lies in Javascript whether it be for a single multiline Field or two Fields.

Regards
maxwyss
Registered: Jul 25 2006
Posts: 256
I have frequently encountered this issue, and my standard approach is to place the text field below the caption, and if ever possible have it cover the line after the caption. This field contains some JavaScript code which sets the fillColor to white when it contains any text, otherwise, it is set to transparent.

The reasoning why this is acceptable is that by filling out the form on screen, you can reach a much higher data density than by filling out by hand on lines. So, the amount of data is still ensured, and the field is a proper rectangle.

The above mentioned logic allows for printing out the form empty to be filled out by hand; it then acts "normal".

Now, if lines are absolutely necessary, an approach would be creating single-line fields just above the drawn lines, and then use some logic to figure out when a field is full and the next one should be used. There is a code sample for that in the Acrobat JavaScript documentation, with the event.fieldFull property.

Hope this can help.


Max Wyss
PRODOK Engineering
Low Paper workflows, Smart documents, PDF forms
CH-8906 Bonstetten, Switzerland

mailto:max [at] prodok [dot] com
http://www.prodok.com



[ Building Bridges for Information ]
[ Getting organized with PDFfolio ]