Skip to content

Instantly share code, notes, and snippets.

@sbrin
Created January 22, 2013 12:45
Show Gist options
  • Save sbrin/4594387 to your computer and use it in GitHub Desktop.
Save sbrin/4594387 to your computer and use it in GitHub Desktop.
A CodePen by A.
<form id="mailform" action="#" method="post">
<textarea name="message" placeholder="Текст тут какой-надо"></textarea>
<br>
<input id="mailbuttom" type="submit" value="Отправить">
</form>
<p id="mailsuccess" style="display:none">Заебись, отправил!</p>
$(document).ready(function(){
$('#mailbuttom').click(function(e){
e.preventDefault();
$.ajax({
data: { message: $('#mailform textarea').val()},
url: 'send.php',
type: 'post',
success: function() {
$('#mailsuccess').show();
$('#mailform').hide();
}
})
});
$('#modal').click(function(){
$('#mailsuccess').hide();
$('#mailform').show();
});
})
#mailform {
text-align: center;
}
#mailsuccess {
display: none;
font-size:130%;
color: green;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment