P
pmind
Hello All,
I have an existing webpage which contains a table of projects. One of
the table fields contains the status of the project (open or closed).
My goal is create a script to show/hide the completed project rows,
making it visually simpler for the user, and to initiate the script
with a single button click at the top of the table. I have succeeded
only in being able to show/hide the first row that I identified in the
code; any additional rows identified are not affected. Can anyone tell
me how I might modify this code to create the effect I’m looking for?
I’m not opposed to a new approach, but it would be nice to tweek what
I’ve already done if possible. I should point out that I am, at best,
a novice programmer. Here is the code I’ve added:
(just above the table)
<script type="text/javascript">
function displayRow(){
var row = document.getElementById("statusCompleted");
if (row.style.display == '') row.style.display = 'none';
else row.style.display = '';
}
</script>
(at each appropriate table row)
<tr id="statusCompleted">
(at the button)
onclick= "displayRow()">
I would be grateful for any help you can provide. Thanks, Paul
I have an existing webpage which contains a table of projects. One of
the table fields contains the status of the project (open or closed).
My goal is create a script to show/hide the completed project rows,
making it visually simpler for the user, and to initiate the script
with a single button click at the top of the table. I have succeeded
only in being able to show/hide the first row that I identified in the
code; any additional rows identified are not affected. Can anyone tell
me how I might modify this code to create the effect I’m looking for?
I’m not opposed to a new approach, but it would be nice to tweek what
I’ve already done if possible. I should point out that I am, at best,
a novice programmer. Here is the code I’ve added:
(just above the table)
<script type="text/javascript">
function displayRow(){
var row = document.getElementById("statusCompleted");
if (row.style.display == '') row.style.display = 'none';
else row.style.display = '';
}
</script>
(at each appropriate table row)
<tr id="statusCompleted">
(at the button)
onclick= "displayRow()">
I would be grateful for any help you can provide. Thanks, Paul