Add to HTML form without losing current form input information in Javascript -
I have a drop, which creates a form based on the selection. Therefore, if a person selects 'FuBar', then it displays the text field, if they choose 'Paneer', this radio button displays the user can enter the data in these forms because they go together Are there. The only problem is that when they add a new form element, all other information is erased. IM is currently using the following to include this form:
Document.getElementById ('theform_div'). InnerHTML = document.getElementById ('theform_div'). InnerHTML + 'This is new content';
How can I get it and add new area to the end?
You need to create a separate DOOM; Add it by calling
tree and appendChild
. For example:
var container = document.createElement ("div"); Container.innerHTML = "..."; . Document.getElementById ("theform_div") appendChild (container);
It is very easy to use.
Comments
Post a Comment