OK I am wanting to build a table that I can enter data in to and have people sort by a drop down box like the 4th table down on this list -- http://www.javascriptkit.com/script/...lefilter.shtml
But I have followed those instructions step by step and it never works. I was told to use .asp I have changed my page to a .asp and now have no clue where to go from here. In searching this site I have found this code --
[CODE]
<script>
function Filter(table){
var f=document.getElementById('f').value.toUpperCase();
for (a=1; a<table.rows.length; a++)
{
if (table.rows[a].cells[0].innerHTML.toUpperCase().indexOf(f)!=0)
table.rows[a].style.display="none"; else
table.rows[a].style.display="table-row";
}
}
</script>
<table id="states" border=1>
<tr><td>State</td><td>Code</td></tr>
<tr><td>ALABAMA</td><td>AL</td></tr>
<tr><td>ALASKA</td><td>AK</td></tr>
<tr><td>MAINE</td><td>ME</td></tr>
<tr><td>MARSHALL ISLANDS</td><td>MH</td></tr>
</table>
<form>
<input type="text" name="f" id="f">
<input type="button" value="Filter" onclick="Filter(document.getElementById('states'));">
</form>
[CODE]
But it gives me a filter that I have to type in. I am looking for drop downs that allow me to filter so say you select drop down for fields that contain "A" then another drop down for a field that contains "B" so the results show fields that contain "A" and "B"
And PS I am semi new to the code world so please don't assume I know some stuff dumb it down a little HAHA
But I have followed those instructions step by step and it never works. I was told to use .asp I have changed my page to a .asp and now have no clue where to go from here. In searching this site I have found this code --
[CODE]
<script>
function Filter(table){
var f=document.getElementById('f').value.toUpperCase();
for (a=1; a<table.rows.length; a++)
{
if (table.rows[a].cells[0].innerHTML.toUpperCase().indexOf(f)!=0)
table.rows[a].style.display="none"; else
table.rows[a].style.display="table-row";
}
}
</script>
<table id="states" border=1>
<tr><td>State</td><td>Code</td></tr>
<tr><td>ALABAMA</td><td>AL</td></tr>
<tr><td>ALASKA</td><td>AK</td></tr>
<tr><td>MAINE</td><td>ME</td></tr>
<tr><td>MARSHALL ISLANDS</td><td>MH</td></tr>
</table>
<form>
<input type="text" name="f" id="f">
<input type="button" value="Filter" onclick="Filter(document.getElementById('states'));">
</form>
[CODE]
But it gives me a filter that I have to type in. I am looking for drop downs that allow me to filter so say you select drop down for fields that contain "A" then another drop down for a field that contains "B" so the results show fields that contain "A" and "B"
And PS I am semi new to the code world so please don't assume I know some stuff dumb it down a little HAHA
Comment