Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
20

Looking for a script that will auto-advance to next field after each word is typed

New Here ,
Aug 04, 2023 Aug 04, 2023

I have sort of a unique ask:

I was sent a form to add fields to, and on the surface it works fine, but i am trying to streamline the process for the people that need to fill it out. for those in the Ham Radio /Amateur Radio world, this is an ICS 213 message handling form.

For those who have no idea what any of that is, here is an example of the standard form i am trying to modify. https://www.ocraces.org/forms/ICS213%20May%202013.pdf

 

if you are using a pen this is easy enough to fill out, but most of our uses can be done on a computer, and i am trying to make this as easy as possible. 

 

The top part of the form, i am fine with "tabing" thorugh the fields, but down in the message body is where i need the help. 

i am wondering if there is a field level script that can be applied where it will auto advance to the next field automaticly when <Space bar> is pressed. 

 

There are 2 sections i need to apply that to. both of them involve 50 text fields. each field should be 1 word each regardless of the number of characters. The key element is using the space bar to advance to the next field, so someone could right a paragraph without using enter or tab. 

 

I already have the form setup, i just need to know the script that i can add to each field that would need this function. 

Thank you for any help you can offer

TOPICS
How to , JavaScript , PDF forms
254
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 05, 2023 Aug 05, 2023
LATEST

You can set the focus to the next field, but you'll have to do it for each field manually, specifying the name of the next field in the row (or maintain an array with all the field names, sorted by tab order), as the script doesn't know what's the next field. The basic code for that is:

 

this.getField("NextFieldName").setFocus();

 

If you want that to happen when the user enters a space, use the following code as the first field's custom Keystroke code (via the field's Properties - Format - Custom):

 

if (event.change==" ") this.getField("NextFieldName").setFocus();

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines