With an external JavaScript file, I'm changing the value of this button below to '5'.
This works, I used console.log to check if the value indeed got changed to '5'.
<form action="getdata.php" method="POST">
<button type="submit" class="firstHeavyGame button" name='storage' value=''>PRESS THE BUTTON</button>
</form>
Then, when this button is clicked it sends the value to the php site where it processes the data.
BUT, I think then clicking this button, the value gets reset to '' '' (blank). Basic HTML (I'm a newb).
So the php script is not receiving any data.
I checked to see if everything else is working by manually entering the value:
<form action="getdata.php" method="POST">
<button type="submit" class="firstHeavyGame button" name='storage' value='5'>PRESS THE BUTTON</button>
</form>
This works correctly (gets the number 5 and passes it on to the php file where it gets processed).
Now I know I'm making a newbie mistake but I can't seem to find an answer for my example when doing my research.
Hope you guys can help me out!