How can I create textbox on click function

bulwinkl

New Member
I am trying to create 2 text box and 1 select box on button click function, but as I am filling boxes created by 1 click and on another click all the filled details get vanished.I want the detail as I fill to be able to post in database ?\[code\]<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document</title> <script> var counter=1; function generateRow() { var d=document.getElementById("div"); d.innerHTML+="<p>&nbsp;&nbsp;&nbsp;&nbsp;<div class='_25'><input type='textbox' id='textbox"+counter+"' name='stop"+counter+"' placeholder='Stop Name'></input></div>&nbsp;&nbsp;&nbsp;<div class='_25'><input type='textbox' id='textbox"+counter+"' name='timing"+counter+"' placeholder='Timing'></input></div>&nbsp;<div class='_25'><strong>Select Route</strong><select id='ampm"+counter+"'name='ampm"+counter+"'><option>a.m</option><option>p.m</option></select> </div>"; counter++; } </script> </head> <body> <form id="form1" name="form1" method="post" action=""> <div id="div"></div> <p><input type="button" value="http://stackoverflow.com/questions/15879618/Add" onclick="generateRow()"/></p> <p> </form> </body></html>\[/code\]
 
Back
Top