Q:

How to post a button's value in html form (PHP)

i have javascript that changes an input's value and when i post the form, the field is not transferred  
<input id="exampleID" type="button" name="exampleButton" value="click me" onclick="changeValue()">  

when the button is clicked the value (displayed to the user) changes to "Clicked"
then when i post the form it the value is left behind  
if(isset($_POST['exampleButton'])) {
    echo "true";
}

this doesn't echo anything
what should i do?

A:

The input button control won't send any value to the server on submit, as it is made to interact with javascript. If you need to send a dynamic value, store it in a field (like an input hidden control), or, if you insist to send it through a button, change its type to submit

