I have a task list.
Initially I display all of them. I want to create 2 buttons s.t. one displays the tasks ordered by date, and the other displays the tasks that have passed.
How can I do this? I don't know how to make a button to do anything else than submit. I was thinking about redirecting to another "page" but I'm not sure it is efficient.
<button type="button" name = 'display1' value="orderedDisplay">Order by date</button>
<button type="button" name = 'display2' value="passedTasks">Passed tasks</button>
or
<table >
<tr>
<a href="orderedbydate.php">Order by date</a>
</tr>
<tr>
<a href="pastevents.php">Display past events</a>
</tr>
</table>
But I don't know how to "catch" the event of clicking with "button"type button.