how to post value from javascript to database in array stile

kennethgoose

New Member
This is my php file this is a script to create texboxes and select box dynamically,now i want to post it in my data base having fields as follow:\[code\]route_number stop_name am_pm timing \[/code\]Can you please help me with CodeIgniter function??\[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 count="<font color='red'>"+counter+"</font>"; var temp ="<p>&nbsp;&nbsp;&nbsp;&nbsp;<div class='_25'>" + "<input type='textbox' id='textbox' name='stop"+counter+"' placeholder='Stop Name'></input>" + " </div>&nbsp;&nbsp;&nbsp;" + "<div class='_25'>" + "<input type='textbox' id='textbox' name='timing"+counter+"' placeholder='Timing'></input></div>&nbsp;" + "<div class='_25'>" + "<select id='ampm" + counter + "' name='ampm"+counter+"'><option>a.m</option><option>p.m</option></select> </div>"; var newdiv = document.createElement('div'); newdiv.innerHTML = temp + count; var yourDiv = document.getElementById('div'); yourDiv.appendChild(newdiv); counter++; } </script> </script> </head> <body> <form id="form1" name="form1" method="post" action=""> <div id="div"></div> <p><input type="button" value="http://stackoverflow.com/questions/15883681/Add" onclick="generateRow()"/></p> <p> </form> </body> </html>\[/code\]
vuLCP.png
 
Top