I can't add rows into table with id myTable2 when I select any number in drop down list using jQuery. I want to add tr inside of this table.
My code is:
<script src="js/jquery.min.js" type="text/javascript">
</script>
<script>
function AddRow(id)
{
alert(id)
for(var i=0;i<id-1;i++)
{
var text_box = "<tr><td><input type='text' name='dest[]' value='' size='30' />
</td> <td><input type='text' name='destsub[]' value='' size='35' />
</td></tr>";
$('#myTable2').append(text_box)
}
}
</script>
DESTINATION COVERED
<select name="covered" id="covered" onchange="AddRow(this.value)">
<?php
for($i=1;$i<=100;$i++)
{
?>
<option value="<?php echo $i; ?>" ><?php echo $i; ?></option>
<?php
}
?>
</select>
<table id="myTable2" width="587" border="0">
</table>
Anybody help me?