Last active
December 26, 2015 23:59
-
-
Save tonijz/7234245 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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