<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
var counter = 1;
$("#addButton").click(function () {
if(counter>5){
alert("Only 5 textboxes allow");
return false;
}
else
{
var table = document.getElementById("formtable");
var rowCount = table.rows.length-1;
var row = table.insertRow(rowCount);
row.innerHTML="<td>Links <font color="\"red\"">*</font></td><td><input type=\"text\" name=\"link[]\" size=\"30\"></td><td></td>";
counter++;
}
});
});
</script>
<title>
Topic HTML
</title>
<link rel="stylesheet" href="Stylesheets/concepts.css" />
<style type="text/css">
div{
padding:1px;
}
aaa{
margin-top:200px;
}
bbb{
margin-top:200px;}
</style>
</head>
<body>
<center>
<form action="Get_Topic.php" method="post">
<h5><font face="Arial, Helvetica, sans-serif" color="#FF0000">* fields mandatory</font></h5>
<div id="TextBoxesGroup">
<div id="TextBoxDiv">
<table id="formtable">
<tr>
<td>Concept Level<font color="red">*</font></td>
<td>
<select id="level_id" name="level_id">
<option name=""></option>
$topic=mysql_query("select * from technology_levels group by level_name");
while($topic_row=mysql_fetch_array($topic)){
echo "<option value=".$topic_row['level_id'].">".$topic_row['level_name']."</option>";
}
?>
</select>
</td>
</tr>
<tr>
<td>Concept Title<font color="red">*</font></td>
<td><input type="text" id="concept_title" name="concept_title" size="30"></td>
</tr>
<tr>
<td>Cocnept Description <font color="red">*</font></td>
<td><textarea id="concept_description" name="concept_description" rows="10" cols="30" ></textarea></td>
</tr>
<tr>
<td>Links <font color="red">*</font></td>
<td><input type="text" name="link[]" id="link1" size="30"></td>
<td><input type='button' value='Add Links' id='addButton'></td>
</tr>
<div id="TexBoxDiv2">
<tr>
<td><input type="button" value="Reset" id="reset" ></td>
<td><input type="button" value="Submit" id="submit" ></td>
</tr>
</div></table>
</div>
</div>
</form>
</center>
</body>
</html>
check code here code.here code adds a new row to your table....