Multi-Step-Form-Js icon indicating copy to clipboard operation
Multi-Step-Form-Js copied to clipboard

Feature request: Multiple sets of control buttons

Open lvmajor opened this issue 6 years ago • 6 comments

Someone asked me if it could be possible to add two sets of buttons for controlling the form process (next/prev buttons)

After a quick look I wondered if it could be done simply by removing the ".first()" call here

What do you think?

lvmajor avatar Aug 08 '18 17:08 lvmajor

Just tested it and it works fine.

Edit: There seems to be a bug causing validation of next step when using the "submit/enter" key on keyboard. I will try to find where it comes from.

lvmajor avatar Aug 08 '18 17:08 lvmajor

so just for my own understanding...a form could have 2 "next" buttons that act identically (for instance one on the top of the form one on the bottom)?

mgildea avatar Aug 08 '18 18:08 mgildea

Exactly, for cases when the form is long enough to have scrolling required in a single step.

lvmajor avatar Aug 08 '18 18:08 lvmajor

Okay so the problem is obviously caused by the fact that my first attempt (removing the .first()) call when finding the navigation, did register both and hence there are two handlers created.

lvmajor avatar Aug 08 '18 19:08 lvmajor

Okay found a workaround, by only using the first registered button when using the key '13' (enter). Don't know if that's optimal though...

Do you think that would be useful/ a potential use case worthy of PR?

lvmajor avatar Aug 08 '18 20:08 lvmajor

can i please get a sample on how to use this

godwindaniel101 avatar Sep 01 '20 13:09 godwindaniel101