Answer Question
Dynamically insert input field to form
Hi quomon people!
How can I, using JavaScript, append form-input-elements to my html-form, to have their values submitted with the form? I have a solution that only works in Firefox so far. Internet Explorer however doesn't recognise these new fields.
I've tried with something like this:
<br>function init(form)
<br>{
<br>var input = document.createElement("input");
<br>
<br>input.name = "c";
<br>input.value = "d";
<br>input.type = "text";
<br>
<br>form.appendChild(input);
<br>}
<br>
I've also tried to add the elements to the form.elements array but no luck. Even tried using the setAttribute method.
Any ideas / experience with this?
TEXT
Uploading file and scanning for virus...
Please Wait