Skip to content

Instantly share code, notes, and snippets.

@tonijz
Last active December 26, 2015 23:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tonijz/7234245 to your computer and use it in GitHub Desktop.
Save tonijz/7234245 to your computer and use it in GitHub Desktop.
<html>
<head>
</head>
<body>
<div class="container">
<div id="modal">
<form method="post" action="">
<input type="text" name="field1" value="test">
<input type="text" name="field2" value="test">
<input type="text" name="field3" value="test">
<input type="text" name="field4" value="test">
<input type="hidden" name="send-email" value="1">
</form>
</div>
<div id="modal-footer">
<input type="checkbox" name="send-email" id="send-email-checkbox"> Send email?
<input type="button" id="submit-button">
</div>
</div>
<script type="text/javascript">
$(function() {
$('#submit-button').click(function() {
// do some ajax stuff
return false;
});
$('#send-email-checkbox').change(function() {
if($(this).is(':checked')) {
$('input[name="send-email"]').attr('value', '1');
}
else {
$('input[name="send-email"]').attr('value', '0');
}
});
});
</script>
</body>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment