Not sure where to put this as it contains HTML, Javascript and PHP and I can't figure out which one is the problem but because the problem is with an empty POST request I put it here, sorry if that is wrong.
<form action="?do=submit" method="post">
<input id="number" readonly="readonly" style="width:7em;"/><br />
<input id="submit" type="submit" style="width: 6em;" value="Generating..." disabled="true"/>
</form>
<script type="text/javascript">
function stop() {
var no = document.getElementById("number");
no.value = number;
}
</script>
<?PHP
if ($do == "submit"){
$number = $_POST['number'];
echo $number . " successfully submitted.";
}
?>
Basically what it is doing is when the user clicks on a element that activates the javascript stop function it sets the value of number to the input fields value (which is set as readonly so the user can not change it.) This part works as the input field shows the value once the function has been executed yet upon submitting the value of $_POST is null, its empty.
I've looked over this again and again and I can't see what is wrong, the only two things I can think of are:
1) There is a typo/error that I keep overlooking
2) Something with the "readonly" field is affecting the form submit.
Can someone point me in the right direction and explain where I am going wrong.