Friday, 9 August 2013

Submit checkbox value to PHP without submit button

Submit checkbox value to PHP without submit button

I have a form with only a checkbox:
<form action="escreve.php" method="post">
<label><input type="checkbox" autocomplete="off" checked="checked"
name="autosave">Autosave</label>
<input type="submit" name="formSubmit" value="Submit" />
</form>
This will trigger escreve.php. It works fine, but the question is how can
I trigger escreve.php without the submit button? It doesn't seem to make
sense in this case since this form has only one input (the checkbox).
I'd like to have escreve.php reading the value of the checkbox whenever
the user clicks in or out. Since I'm also using jQuery, would that be
possible?
Thanks for any help!

No comments:

Post a Comment