hello im trying to post some data when visitors click on a "td"
here is the code
<form method="post" name="randoms">
<tr><td value="1" name="somedata">Click me 1</td></tr>
<tr><td value="2" name="somedata">Click me 1</td></tr>
<tr><td value="3" name="somedata">Click me 1</td></tr>
<tr><td value="4" name="somedata">Click me 1</td></tr>
</form>
Soo what i want here is that if a visitor clicks at "Click me 1" it post the form and then il be ablee to grab the somedata whit php.
<?php
$somedata = $_POST["somedata"];
?>
ive tried to solve this for a while now but i can just not find a way to do this, im pretty sure there are loots way to do it ive just not found one of those ways.
ive tried this javascript.
<script type="text/javascript">
function submitForm(sub) {
document.forms[sub].submit();
}
</script>
and then ive tried to use
<a HREF="#" onClick="submitForm('randoms')"> Somedata1 </a>