<html>
<body>
<input type="checkbox" checked="checked">
</body>
</html>
I am looking for a solution to pass the value of a checkbox as either 1 or 0 depending on its selection status. When the checkbox is checked, I want to send the value 1 to a PHP file, and if it is unchecked, I want to send the value 0. I intend to use an onClick event in the HTML along with AJAX to send the value.
Being new to AJAX, I am facing challenges in finding a way to achieve this task.
Your help and guidance will be greatly appreciated. Thank you.