New to LiveCycle but have figured out dynamif forms and textfields that flow from page 1 to the next page if needed. What I need to do is have "textfield1" fill but not expand and then as the user types, the focus needs to chane to textfield2 automatically and start filling.
There are other fields betwen "textfield1" and "textfield2" that cannot move.
I'm totally new to javascripting and just cannot figure this out. Help would be greatly appreciated, including errecting statues of you in my office.
Views
Replies
Total Likes
See if this helps..
https://acrobat.com/#d=1o1rXLswbe*O0UvnLCDSZA
I am checking the length of the First TextField value and if it exceeds certain number, I am setting the focus to Second TextField..
Code is in the change event of the First TextField.
Thanks
Srini
You can also place this script in the full event of textfield1:
xfa.host.setfocus(form1.subform1.textfield2);
where form1 would be replaced with your form name and subform1 would be replaced with the name of the page that textfield2 is on. This works no matter the font size or textfield size, but of course textfield1 must be set to not expand.
Views
Replies
Total Likes
Interesting question. Srini's approach works well for fields with monospaced input fonts such as Courier.
I've been experimenting with the scenario of not having to limit the amount of characters.
So far I've come up with the following (the two text fields are called f1 and f2):
//f1::full
f2.rawValue = xfa.event.fullText.replace(xfa.event.newText, "");
xfa.host.setFocus(f2);
//f2::change
if (!xfa.event.selStart)
xfa.event.change = xfa.event.prevText+xfa.event.change;
Ugly, I know, but it does the job for slow-typers.
Being able to alter xfa.event.target before Acrobat commits the event would be nice...
Views
Replies
Total Likes
djaknow: I think you will lose a character in the transition.
This may work if I could easily calculate the total character length of the field. Any suggestions?
Views
Replies
Total Likes
Well this looked easy, but once I tried it, it didn't work. Got some error messages and yellow yield signs on my textfield1. Textfield1 should be set to Limit to visible area right? what else should i check?
Views
Replies
Total Likes
That's true, the user would have to realize the focus has changed and add the missing character. The only advantage is that it doesn't require monospaced font.
Views
Replies
Total Likes
Well, that won't do because they probably won't notice.
Views
Replies
Total Likes
No matter which method you use, either the user will have to pay attention or you'll have to find a way of figuring out whether or not a word cut off in the middle. Even with monospaced font and a fixed number of characters allowed it's still highly likely you're going to be in the middle of a word when the switch to the new field occurs.
Views
Replies
Total Likes
Well, if they cannot do it without paying attention (um, my clientbase is not a group of great typers so they are likely to be looking at the keyboard), wouldn't it be easier to just make textfield1 limited and then have then reset the tab order to textfield2 opposed to using a script? It sure seems to me that there should be a way so that it is seemless to the user.
Views
Replies
Total Likes
You could still use the script to make the change but then maybe also pop up a message box telling the user what happened? I don't know of a way to effect a switch to a new text field midstream without any user attention required.
Views
Replies
Total Likes
Is this correct? My two fiels are Narrative12 (f1) and Narrative 13 (f2)
//Narrative12::full
Narrative13.rawValue = xfa.event.fullText.replace(xfa.event.newText, "");
xfa.host.setFocus(Narrative13);
//Narrative13::change
if (!xfa.event.selStart)
xfa.event.change = xfa.event.prevText+xfa.event.change;
Views
Replies
Total Likes
LOL. We don't seem to be alone.
Views
Replies
Total Likes
Spot on! Have you tried it?
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies