This confirmation can be tied to any HTML widget not just a submit button.
The JavaScript code below shows how to do this:
$(document).ready(function() {
$('#confirm').click(function() {
var checked = $('#terms').attr('checked');
if(!checked)
{
return confirm('Are you sure?');
}
return true;
});
});
The above JS function is tied to onClick() event on the button with id="confirm" on an HTML form. The HTML form is unaware of this function, the button code is simply
< input type="checkbox" checked="" id="terms"/>
< input type="submit" value="Create New Zone" id="confirm">