Page 2 of 2
Re: enter key perform like a tab, thru fields?
Posted: Tue Apr 14, 2015 10:34 pm
by Paul
Scott, Eric,
Excellent, just what I was looking for.
Thanks!
Paul
Re: enter key perform like a tab, thru fields?
Posted: Fri Sep 27, 2019 12:47 pm
by pjshuey
Scott,
I save your comment above "How would you like to proceed? Should I look into making a pui.gotoNextElement() and pui.gotoPreviousElement() API to make this work better? (We have something like this already under the covers in PUI. With a little bit of work, I could make it accessible to customers like yourself.)". Did you ever do anything with this? I am trying to simulate a tab key in a javascript function and am struggling. If you could help, I would really appreciate it!
Patti
Re: enter key perform like a tab, thru fields?
Posted: Fri Sep 27, 2019 12:50 pm
by Scott Klement
mrssmitty15 never replied to the question about that (this was more than 4 years ago) so I never did anything.
Re: enter key perform like a tab, thru fields?
Posted: Fri Sep 27, 2019 1:06 pm
by pjshuey
I saw she didn't reply. Is this something that can be done? If you point me in the right direction, I can probably figure it out. I was thinking of using querySelectorAll to get all input fields on the screen. I haven't figured out exactly how to use that information yet.
Re: enter key perform like a tab, thru fields?
Posted: Fri Sep 27, 2019 1:12 pm
by Scott Klement
pjshuey wrote:I saw she didn't reply. Is this something that can be done? If you point me in the right direction, I can probably figure it out. I was thinking of using querySelectorAll to get all input fields on the screen. I haven't figured out exactly how to use that information yet.
I'm not quite following you, here. What do you need me to point you in the direction of?
If you're asking for the pui.gotoNextElement() and pui.gotoPreviousElement() APIs to be created as I suggested 4 years ago, then the best way to do that is to e-mail
support@profoundlogic.com and place a feature request for those.
Re: enter key perform like a tab, thru fields?
Posted: Fri Sep 27, 2019 1:14 pm
by pjshuey
I was asking for some tips on how to do it myself, but I will email support asking for the functions you mentioned. I think they could be useful for other people as well. Thanks.
Re: enter key perform like a tab, thru fields?
Posted: Fri Sep 27, 2019 1:30 pm
by Scott Klement
If you wanted to do it yourself, you'd get an array of the fields on the screen (using something like querySelectorAll would help you do that.) Then you'd locate the field you are in, and determine which field comes after it. Then set focus on that next field.
You could have sophisticated code to control the sequence of the fields, et al. You'd also have to do stuff like skip fields that are hidden or protected.