Advance to next field after keypress

Duke3D

Member
Fabrik supports the onkeypress event. What I am wondering is if there is an easy way in the code to identify the next field of a form so that for a field that takes a single character or say three characters like a phone area code, focus will be automatically advanced to the next field. Is this best done by adding specific code to each field to reference a hard coded next field's ID or can it be made more generic to find itself in the DOM and then increment the index number of the form element? This is beyond my knowledge of the Fabrik arrays and how fabrik element IDs can be anticipated and referenced and may be a little beyond my DOM manipulation skills so all suggestions appreciated.
 
Thanks for that link Hugh -
Any thoughts or examples on two other topics?
1) How to execute a "Save and Next" button in addition to "Save" to redisplay a Form with the next record loaded by incrementing the ID?
2) How to execute a List style table view that is also editable. Displays like a table of scores made with Google Sheets - each cell can be edited and the change committed when focus leaves the row. I saw the Inline Edit plugin is not recommended if there is a database join element. A join is used to lookup a name for each row of scores.
 
1) you might be able to do with a PHP form submission plugin running onAfterProcess, which does a $app->redirect(). You'd probably want to do a lookup for the next id rather than just incrementing it, in case any rows have been deleted.

2) The Inline Edit is the closest you'll get, we don't have anything else.

-- hugh
 
The tabbable library is slick - worked well for what I wanted to accomplish, thanks!

Good suggestions, I appreciate you pointing me in the right direction!
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top