What is the best way to intercept this kind of form?
I have a form that contains a lot of dynamic set of form inputs and types. These elements are generated on the server. The id's/name's of these elements are also dynamic, depending on the database.
To make things more complex, these tags need to hold state and be able to restore state at any time.
I managed to do all of this, but I did it in such a way that I use <input>, <textarea>, etc. elements as well as a submit button, but I am not using <form>. This works just fine when the user "clicks" the submit button.
Unfortunately, if they press "enter", it no longer submits like a real form.
How can I get this behaving more like a real form but also hijack the form process entirely? Meaning, I don't want to specify an action or anything. I just want to get form symantics without putting anything specific on <form>.
I also don't want to send the form data "as is" - this would be very bad. I need to preprocess it and package it up in a way that my server understands - a different structure, and I want to send it as JSON. So basically I just want to hijack all of the default behaviour.
Is there a way? I'm pretty new to jquery and I think my users might not like that "enter" no longer works.