how to get the values of textboxes
Posted: Wed May 28, 2014 2:35 am
I am using following code to add dynamic arrays...using this how to get the value of textboxes..i need to insert the textbox value to mysql database using php
Code: Select all
<script>
var counter=1;
function generateRow() {
var count="<font color='red'>"+counter+"</font>";
var temp ="<p> <div class='_25'><input type='textbox' id='textbox' name='stop"+counter+"' placeholder='Stop Name'></input></div> <div class='_25'><input type='textbox' id='textbox' name='add"+counter+"' placeholder='Address'></input></div> ";
var newdiv = document.createElement('div');
newdiv.innerHTML = temp + count;
var yourDiv = document.getElementById('div');
yourDiv.appendChild(newdiv);
counter++;
}
</script>
<div id="div">
</div>
<p> </p>
<div class="_25">
<p>
<input type="button" name="button" class="button red" id="button" value="Add" onclick="generateRow() "/></a>
<label>
<input type="submit" name="save" id="save" value="Submit" onClick="getValue()">
</label>
</p>
</div>