Copy link to clipboard
Copied
Hello,
I am trying to get type to flow from one text box to another but every script I try isn't working. I'm not sure what I'm doing wrong. I have typed the script in and pasted the script. Is there anyone that has any knowledge of how I can make this work? Thank you for your help.
Copy link to clipboard
Copied
Please share what script are you using.
Also, would you mind providing more info on what you mean by text wrapping and flowing from one textfield to another?
Copy link to clipboard
Copied
Hello,
This is the script I have tried amongst others.
if (event.fieldFull || event.willCommit) this.getField("What happened 2").setFocus();
I have attached photos of my document as well for reference. I don't want to use one box with the multiline function as it is difficult to adjust the leading and I want the type to line up above the line.
Copy link to clipboard
Copied
I am still learning JavaScript and at a first glance it seems like there's nothing wrong with the script.
But I would've declared the willCommit event slightly different, and I would use this script as a Custom Keystroke Script.
Make sure this is where you're running the willCommit event from.
Hopefully someone with more experience can confirm if what I'm observing is correct.
But anyhow, this how I would use your script as a Custom Keystroke event:
if (event.willCommit) {
if (event.fieldFull) this.getField("What happened 2").setFocus();
}
Like I said, I am unsure if I did it right, but I am typing from a mobile device and I haven't tested if the script above is OK or will throw any errors.
However, I think the most important observation is that I noticed that the texfield objects have very long name as sentence phrasing with spaces in between words.
That is not a good field object naming convention when using Acrobat JavaScript since it is known for sometimes throwing errors, specially if a field object is used for calculating events.
I would suggest to first try your original script but changing the fieldnames to something short and preferably using a parent-child naming hierarchy, like for example:
"How.0", "How.1", "How.2", etc.
"What.0", "What.1", "What.2"
"Change.0", "Change.1", "Change.2",
Let us know if this helps.
Copy link to clipboard
Copied
Thank you for the quick response! I don't know any JavaScript and I am definitely winging it. I will try the script I have been using but shorten the field names. If that doesn't work I will try the script you've provided. Thank you for helping me out. Much appreciated. I will keep you updated.
Copy link to clipboard
Copied
You're welcome.