I have a page that shows a modal dialog onload. There's a checkbox that user needs to check and submit (think Terms of Use) before the modal is dismissed. Once that happens the page can be reloaded again, but the dialog box should never come back. Originally I thought of using PHP session but I want to dismiss the dialog box with JS (jQuery) without reloading the page. What is an alternative? Can I use cookies for the duration of the session?
My current code looks like this:
JS:
$(document).delegate('#myButton', 'click', function() {
if ($('input[name="myCheckbox"]').is(':checked')) {
$('#myDialog').remove();
}
});
HTML:
<div id="myDialog">
text
<input type="checkbox" name="myCheckbox"> <input id="myButton" type="button" value="click me">
</div>