|
-
Jul 9th, 2001, 09:39 AM
#1
Thread Starter
Addicted Member
Multiple table rows to hide
Hi!
I have this HTML table in which I have rows displaying each a TEXTBOX and a SELECTBOX. I want to delete a row on the click of a button. I do this with the style.display="none" property and it works except that the SELECTBOX does not get hidden. It look as though it's a screen refresh problem but am not sure. Has anyone gotten this problem before ? How did you fix it?
Thanks
-
Jul 9th, 2001, 06:38 PM
#2
Fanatic Member
For what element are you setting display = 'none'?
The code below works fine for me...
<html>
<head>
<title></title>
</head>
<body>
<form>
<table>
<tr ID = "row1">
<td><select><option>One</option><option>Two</option></select></td>
</tr>
<tr>
<td><input TYPE = "button" VALUE = "hide row" ONCLICK = "row1.style.display = 'none';"></td>
</tr>
</table>
</form>
</body>
</html>
Chris
-
Jul 10th, 2001, 08:41 AM
#3
Thread Starter
Addicted Member
I also have text box in each row
<html>
<head>
<title></title>
</head>
<body>
<form>
<table>
<tr ID = "row1">
<td><input type=text name="amount"> GL No:<select><option>One</option><option>Two</option></select></td>
</tr>
<tr>
<td><input TYPE = "button" VALUE = "hide row" ONCLICK = "row1.style.display = 'none';"></td>
</tr>
</table>
</form>
</body>
</html>
... is what I have in more than one row and I set the display none for the TR (Table row) but the <select> does not hide... I have to create a function and hide both the Table row AND the <select> but that gives me other problems:
when I want to display them back (display="block") then it displays on two lines but it was originaly on only one line... weird stuff ?!?
-
Jul 10th, 2001, 05:27 PM
#4
Fanatic Member
David,
I altered it a bit and this still works for me:
<html>
<head>
<title></title>
</head>
<body>
<form>
<table>
<tr ID = "row1">
<td><input TYPE = "text"></td>
<td><select><option>One</option><option>Two</option></select></td>
</tr>
<tr>
<td><input TYPE = "button" VALUE = "Hide Row" ONCLICK = "row1.style.display = 'none';"></td>
<td><input TYPE = "button" VALUE = "Show Row" ONCLICK = "row1.style.display='';"></td>
</tr>
</table>
</form>
</body>
</html>
The select element hides and shows as it's supposed to. Instead of using "block" try using '' (two single ticks).
Chris
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|