<html>
<head>
 	<script>
       var  cur3=5;
       var obs=[];

        function newrow(r){
              var rowCount = document.getElementById('myTable3').rows.length;
              var x=document.getElementById('myTable3').insertRow(rowCount);
              var a=x.insertCell(0)
		var y=x.insertCell(1)
		var y1=x.insertCell(2);

              a.innerHTML=cur3;
              y.innerHTML="<textarea   name=obs[] id=obs"+cur3+"></textarea>"; 
              y1.innerHTML="<input type='button'  onClick='delrow3(this)' value='X' >";
           
              cur3++; 

         }

        function delrow3(r){
           
           var i=r.parentNode.parentNode.rowIndex;
           document.getElementById('myTable3').deleteRow(i);
            
         }

       </script>


</head>
<body>
<?

	session_start();
include("test.php");
include("opendb.php");

?>
<fieldset style="border:2px solid white; border-style:dotted;"><legend>Add Observation</legend>
       <table id='myTable3' >

         
		<th>slno<th>Observ<th>Del
		<tr><td>1</td><td><textarea name='obs[]' id='obs1'></textarea></td><td><input type='button' name='del' value='X' onclick='delrow3(this)'/></td></tr>
		<tr><td>2</td><td><textarea name='obs[]' id='obs2'></textarea></td><td><input type='button' name='del' value='X'  onclick='delrow3(this)'/></td></tr>
		<tr><td>3</td><td><textarea name='obs[]' id='obs3'></textarea></td><td><input type='button' name='del' value='X'  onclick='delrow3(this)'/></td></tr>
		<tr><td>4</td><td><textarea name='obs[]' id='obs4'></textarea></td><td><input type='button' name='del' value='X' onclick='delrow3(this)'/></td></tr> 
	</table>
       <button name='obs_save' id='obs_save' >Save</button>
	<a href='#' id='addbutton' onclick='newrow(this)'> <button >Add new</button></a>

     </fieldset>
	
</body>
</html>

