
03-30-2006, 02:53 AM
|
|
Junior Member
|
|
Join Date: Feb 2006
Posts: 5
|
|
unable to find solution: combobox,resettin data on form reload
hi...
i hav 3 doubts...
1 . How to delete a row from table... Each row of My table contains one combobox and Text box....
2. with every button click i am creating a combo and text box in a table...
i am already havin a text box and Combo box(with options) in the table...
the option in the combo box are taken from DB.. using PHP tag...
NOW the problem is the new combobox which is gettin created is not showin those options....
The Code I hav Written :-
Quote:
<script language="jvascript">
function insRow(ch)
{
var tmp=ch.sub_cnt.value;
tmp++;
ch.sub_cnt.value=tmp;
var x=document.getElementById('mytab').insertRow(++tmp)
var y=x.insertCell(0)
var z=x.insertCell(1)
var txt1=document.createElement("select");
var txt2=document.createElement("input");
txt2.size="8";
txt2.maxlength="5"
y.appendChild(txt1);
z.appendChild(txt2);
}
//INSIDE FORM TAG
<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>
|
3. how to REset the value of a text box everytime a form is reloaded....
Code that i hav written :-
Quote:
<script language="jvascript">
function reloading(ch)
{
ch.sub_cnt.value="1";
}
</script>
<form name=criteria_frm action="app.php" method="POST" onload="return reloading(document.criteria_frm)">
<input type="text" name="sub_cnt" value="1">
|
Expectin REply... 
|