I am trying to make a list of anchors that will submit the value of the one clicked and redirect to another page. The form is:
<form id="searchCategory" action="test.php" method="post">
<div id="categories">
<details>
<summary>Beers</summary>
<a href="test.php" onclick="document.getElementById("title").submit();"> <input id="title" name="title">Lager </input></a>
<a href="#"> Ale</a> //would make as above
<a href="#">Pale Lager </a> // same
</details>
</form>
The top of the test.php is this:
<?php
if (!empty($_POST['submit'])){
include ("connection.php");
$title = (trim($_POST['title'])=="")?
die ("You did not enter any search criteria"):
mysql_real_escape_string($_POST['title']);
The anchor redirects me to the test.php page but the value doesn't seem to be submitted.