Forum Moderators: open
<form id="theForm" ...>
<div>
...
<input type="checkbox" name="sendEmail">
...
</div>
</form>
<script type="text/javascript">
(function () {
// Attach onsubmit listener to your form
var theForm = document.getElementById('theForm');
theForm.onsubmit = function () {
var result = true;
if (this.sendEmail.checked) {
result = confirm('Are you sure you want email?');
}
return result;
};
})();
</script>