hi...
thanks 4 the reply...
i am also doing the same thing...
but when i am clicking a button to create another select box its not containing the same data....
already i hav select box with the options from DB in the table...
its like drop down list
i hav used javascript for the button name "MORE"...
The code is as follows :-
Quote:
<script language="Javascript">
var theTable,where;
function addRow(form)
{
theTable=document.getElementById("mytab");
where=form.sub_cnt.value;
var newRow = theTable.insertRow(where);
var y=newRow.insertCell(0);
var z=newRow.insertCell(1);
var txt=document.createElement("input");
var sel= document.createElement("select");
txt.size="8";
txt.maxlength="5"
++where;
form.sub_cnt.value=where;
z.appendChild(txt);
y.appendChild(sel);
}
</script>
|
Inside the form tag the code is as follows :-
Quote:
<form name="criteria_frm" action="file.php?group=criteria_frm.grp_id.value" method="POST">
<tr><td bgcolor="#FFFFFF">
<select name="subject_id[]">
<option value="-1">[All Subjects]</option>
<?php
$s = "select id, title from category order by title";
$conn = getConnection();
$rs = pg_query($s);
if($rs!=null)
{
while($row = pg_fetch_row($rs))
{
echo "<option value=\"$row[0]\">".addslashes(chop($row[1]));
pg_free_result($rs);
}
pg_close($conn);
?>
</select>
</td>
<input type="button" onclick="return addRow(document.criteria_frm)" value="More">
|