I have 1 form, with 2 Submit buttons.
When I click one button, I want certain values to be posted. When I click other button I want other values to be posted.
This is what I tried, did not work:
<form action="/test" method="post">
<input type="hidden" id="bool" name="bool" value="" />
<input type="submit" value="Yes" onclick="test()" />
<input type="submit" value="No" onclick="test1()" />
</form>
<script type="text/javascript">
function test() {
document.getElementById('bool').value = "true";
}
function test1() {
document.getElementById('bool').value = "false";
}
</script>
Use this instead: