I have a html-file which makes a table with 3 columns and dynamic rows. The data for the table will be read in from a java project. The java project doesn't matter here. I also did a drop-down-menu on my table for the first column with two entries. Now I would like to filter my table when I choose one entry of the drop-down-menu. How can i do that? How do I need to use JavaScript here?
See the code below (only html because I don't know what to do in Javascript)
<table>
<colgroup>
<col width="150" style="background-color:red"></col>
<col width="165"></col>
</colgroup>
<tr style ="background-color:grey">
<th>
Plane
<select size="2" name="choice">
<option selected="selected">number_1</option>
<option>number_2</option>
</select>
</th>
<th>date</th>
<th>addition</th>
</tr>
<xsl:for-each select="logstore/plane/trigger">
<tbody>
<tr>
<td><xsl:value-of select="../name"/></td>
<td><xsl:value-of select="date"/></td>
<td><xsl:value-of select="addition"/></td>
</tr>
</tbody>
</xsl:for-each>
</table>
onchange eventto your drop down, then either do some hide and show magic for rows in your table, or send anajaxrequest to the server to return only results that match your filter and re-populate your table body.