Skip to main content
sdbrigma
Participant
April 19, 2017
Answered

Is it possible to backspace text through multiple text fields in a form?

  • April 19, 2017
  • 1 reply
  • 1181 views

I need to be able to backspace text through different text fields in a form.  My code creates another field and sets it to focus when you reach the end of the text field, so I'm just trying to do the opposite now. Is that possible in Acrobat JavaScript?  As a bonus, is it also possible to have text flow from multiple text fields in a form if you're deleting from an above text field?  I'm essentially trying to implement how a Word document's text flows in a pdf form with multiple text fields.

This topic has been closed for replies.
Correct answer Joel Geraci

Technically, yes. It can be done... but I don't recommend it. The script needs to constantly evaluate the length of the fields and recalculate where the text needs to go. It's essentially impossible to create something that works as well as a word processor.

Instead, consider capturing all of the text in a dialog box and then populating the fields, breaking the text into chunks as appropriate. To exit the text, clicking the field would reopen the dialog and allow the user to type normally. Closing the dialog again would re-chunk the text.

1 reply

Joel Geraci
Community Expert
Joel GeraciCommunity ExpertCorrect answer
Community Expert
April 19, 2017

Technically, yes. It can be done... but I don't recommend it. The script needs to constantly evaluate the length of the fields and recalculate where the text needs to go. It's essentially impossible to create something that works as well as a word processor.

Instead, consider capturing all of the text in a dialog box and then populating the fields, breaking the text into chunks as appropriate. To exit the text, clicking the field would reopen the dialog and allow the user to type normally. Closing the dialog again would re-chunk the text.

sdbrigma
sdbrigmaAuthor
Participant
April 20, 2017

I wasn't aware that dialog boxes were available in Adobe Forms.  That is a much better alternative!  Just out of curiosity, what problems would a form have if it were created like a word processor, aside from it possibly being slow to work through since it'll constantly be recalculating text?

Joel Geraci
Community Expert
Community Expert
April 20, 2017

I'm not sure where to even start on the problems...

  1. Inserting text is pretty easy but maintaining the insertion point after a deletion can be problematic.
  2. You can't select text across the break.
  3. Depending on where your fields are, you can get a lot of page jumping as your edits force the content to "reflow".

At best, it's a truly horrid experience.