Im using jquery and want each form text input to appear one by one, the user to enter the data and then the next one to appear. After they have completed the whole form in single question segments, I want the whole form’s responses to be submitted.
Is this possible? Or do I have to make the form appear in its entirety to get my desired result?
Thanks in advance.
Wow, everyone is quicker than me, well I’ll throw my hand in the pot:
This jsFiddle shows you the implementation I came up with. It shows how you basically traverse around the form to get the next container and show it when the enter key (13) is hit.
Dont forget to stopPropagation / preventDefault otherwise you’ll end up submitting the form when the enter key is hit.
You can add an exception for when the item is the final element to call $(this).parents(“form”).submit(); instead of trying to find the next element and show it.