mgildea / Multi-Step-Form-Js

Multi Step Form with jQuery validation
MIT License
49 stars 25 forks source link

Feature request: Multiple sets of control buttons #20

Open lvmajor opened 6 years ago

lvmajor commented 6 years ago

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 commented 6 years ago

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.

mgildea commented 6 years ago

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)?

lvmajor commented 6 years ago

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

lvmajor commented 6 years ago

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 commented 6 years ago

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?

godwindaniel101 commented 4 years ago

can i please get a sample on how to use this