jQuery Break form into steps

2019-09-17 10:11发布

问题:

I have a little jQuery script where a user is able to create and append form fields to create a form. I'm adding a feature where a user can add page break anywhere in the form so that the form can split into parts. So first part shows the fields until it detects page break, then user clicks on next, and the second set of fields will show until page break and so on. I was thinking i could break the pages using <hr/> so each set of fields will show until the <hr/> break.

The idea is a little vague. How would you approach this?

回答1:

There are some plugins that do this. I have used http://thecodemine.org/ with success. There are a lot of plugins to do this, just Google jQuery form wizard.



回答2:

You could hide each form section and add a listener to each 'next' button to show the subsequent form section.



标签: jquery forms