I’m trying to dynamically create a form using JQuery.
In order to do this, I have created javascript code that injects tags into the initially empty form based on user selections. – I would not to NOT change this type of functionality if possible.
On load, my form is like this:
<form method="post" action="complete.jsp" id="band">
<span id="select-form"></span>
<input type="submit" value="Create band" />
</form>
Once one item is added it looks like this:
<form method="post" action="complete.jsp" id="band">
<span id="select-form"><input type="hidden" value="hello" /></span>
<input type="submit" value="Create band" />
</form>
The difference being that the input field now appears.
The problem is that when the form is submitted, NO VARIABLES ARE BEING SENT!
i don’t understand why, or how to fix it. Any advice?
Add attibute name for input form: