'Data Not Shown In database Only shown array
when fill information in the below of add more address and then click for new address on add more address and fill data only previous filled data display not display the new data in databse only display array
<h3>Delivery Address</h3>
<form name="register" method="post" action="insert.php" >
name<br /><input name="name" type="text" size="20" /><br />
email<br /><input name="email" type="text" size="20" /><br />
password<br /><input name="password" type="password" size="20" /><br />
address:<br>
Line 1<br /><input name="address" type="text" size="20" /><br />
city<br /><input name="city" type="text" size="20" /><br />
state<br /><input name="state" type="text" size="20" /><br />
<div id="itemRows">
<input onclick="addRow(this.form);" type="button" value="add more address" /><br>
Line1 <br><input type="text" name="address1" size="20" /><br/>
city<br> <input type="text" size="20" name="city1" /> <br />
state<br /><input name="state1" type="text" size="20" /><br />
</div>
<input type="submit" name="submit" value="submit" />
</form>
<script>
var rowNum = 0;
function addRow(frm) {
rowNum ++;
var row = '<p id="rowNum'+rowNum+'">Line1 <input type="text" name="address1" size="20" value="'+frm.address1.value+'"> city<input type="text" name="city1" value="'+frm.city1.value+'">state <input type="text" name="state1" size="20" value="'+frm.state1.value+'"> <input type="button" value="Remove" onclick="removeRow('+rowNum+');"></p>';
jQuery('#itemRows').append(row);
frm.address1.value = '';
frm.city1.value = '';
frm.state1.value = '';
}
</script><script>
function removeRow(rnum) {
jQuery('#rowNum'+rnum).remove();}</script>
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
