my problem is that, i have a button that contains values and carry it to javascript
here is the code below for the button that carries value 1;
<button onclick="passValue('1')">Pass Me</button>
here is the javascriptfunction that will be called by the button above;
and this script would set the value into a form input;
below the script is the form where the value should be pass.
<script language='javascript'>
function passValue(val){
document.getElementById("myValue").value=val;
}
</script>
<form name="myForm" method="Post" action="getValue.php">
<INPUT TYPE="hidden" name="myVal" id="myValue" />
<INPUT TYPE="submit">
</form>
getValue.php
<?php
echo $_REQUEST['myVal'];
?>
Problem: when the form was submitted to getValue.php, the value displays nothing. in short the value that was set by the javascript function for 'myValue' id is not passed to the getValue.php...
is there anyone who can help me solve this problem?