$j=1; ?> var t =''; var options = "";
</script>
<?php
foreach ($this->data['DEFAULTS'] as $rec){
foreach ($rec as $key=>$val){
?>
<script type="text/javascript">
var cntr = "<?php echo $j;?>";
var reference_value = '<?php echo $val["GETVAL"];?>';
var sel = '<select name="code[]">'+options+'</select>';
var txt = '<input type="text" class="TextBox" name="referencevalue[]" valign="top" value="'+ reference_value +'">';
t += '<tr id ='+cntr+'><td>'+cntr+'</td><td valign="top">'+sel+'</td><td valign="top" ailgn="center">'+txt+'</td></tr>';
</script>
<?php
$j++;
}
}
?>
<script type="text/javascript">
alert("MYTABLE "+t);
$("#ref").append(t);
</script>
when i say alert(t) iam getting the entire table structure and the data but iam not able to add it to the table
.Here is the Table Structure where i have to add
<table width="100%" cellspacing="2" cellpadding="2" align="left">
<tbody><tr>
<th class="coltextleft">
<span style="font-size: 14px; font-weight: bold;" id="id_refTbl">
<img id="IMG1" height="15" width="15" align="middle" src="cllpsed.gif"/> </span>
</th>
</tr>
<tr><td>
<div id="ref" style="display:none">
<table id="ref" width="100%" class="formTable">
<tr>
<td> </td>
<td> Code</td>
<td> Value</td>
<td> </td>
</tr>
<tr><td>I need to add the result of alert(t) with inthis rows</td></tr></table>