A recent solution of mine in JavaScript involves dynamic creation of additional input of type text. This is to accommodate the scenario when the user has used up all existing text fields. Are there good articles or guidelines on delivering this solution? I plan to do the basic due dilligence... i.e. making sure dyanmic fields have data, within the bound. What challenges have you guys seen?
Using a combination of createElement and appendChild you can add any type of new element to the document, there is other ways to do this but I found that this worked best: var div1 = document.getElementById("myDiv"); ................. tbox = document.createElement("input"); tbox.setAttribute("type","text"); ...(set other attributes here)... div1.appendChild(tbox); Code (markup):