What I want to do is, when a user lands on the form. I want the first input to be active, so the user is able to click in, select or fill it out. I want them to fill out the form step by step so I want the next input only to activate once they have filled out the current input.
I also want the submit button to be deactivated and not to be activated until all the inputs are filled out.
What's the best way of achieving this?
I have attached an image to illustrate what I'm trying to do.
This might give you a nice starting point: Fiddle
Add a
step
class to each of your form elements (I do believe for this to work they need to be each other's siblings):Then, use the
next()
function to find the next step in the form when something changes, and either disable or enable it (or all next steps, if the element was empty):For TAB functionality, the following is a quick fix, which I'm sure can be somehow integrated with the above function.
Few things to consider:
Forms can be submitted by either clicking a button with a type="submit" or by a return key.
So, in order for you to achieve the desired effect: