using js to add a form input, but retaining typed info? - Printable Version -Shoutbox (https://shoutbox.menthix.net) +-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58) +--- Forum: Skype & Technology (/forumdisplay.php?fid=9) +---- Forum: Tech Talk (/forumdisplay.php?fid=17) +----- Thread: using js to add a form input, but retaining typed info? (/showthread.php?tid=91564) using js to add a form input, but retaining typed info? by stoshrocket on 07-19-2009 at 10:27 PM
I've quickly knocked up the following: html code:...which just adds a form input when you click the add input link. However, I want to be able to retain the information pre-entered in the inputs, so if I typed something into the first input, click add another, and I would have whatever I typed in the first plus another input (currently it just replaces the div contents with a new set of inputs). Any ideas? RE: using js to add a form input, but retaining typed info? by felipEx on 07-19-2009 at 11:14 PM
Use createElement and appendChild JavaScript code: this should do the trick RE: using js to add a form input, but retaining typed info? by stoshrocket on 07-20-2009 at 03:13 PM Perfect thanks very much |