I have code that looks like this:
<?php
for ($i = 0; $i < count($keyArray); $i++) {
?>
<form action="" method="POST">
<th>
<a href="#" onclick="$(this).closest('form').submit()">
<?php echo $keyArray[$i] ?></a>
</th>
<input type="hidden" name="tableHeader" value="<?php echo $keyArray[$i]; ?>">
</form>
<?php } ?>
I'm trying to submit the form through a link. To test the form, I use:
echo "<pre>";
print_r($_POST);
echo "</pre>";
I've tried using a button type submit, and it works. I don't know what's wrong with the jQuery in my onclick, but the info is not being sent.