Open Source Development Tutorials | Newsletter Signup | About Us
Search  

Go Back   Open Source Tutorials Forum > Web Development > HTML, JavaScript & CSS
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read


Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 03-30-2006, 02:53 AM
manashi_130582 manashi_130582 is offline
Junior Member
 
Join Date: Feb 2006
Posts: 5 manashi_130582 is on a distinguished road
Question 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...
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump



All times are GMT -5. The time now is 07:21 AM.


Powered by: vBulletin Version 3.0.1
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright 2004 - 2006 GrindingGears.com. All Rights Reserved.