Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script type="text/javascript" src="js/jquery-1.2.6.min.js"></script>
- <script type="text/javascript">
- // we will add our javascript code here
- $(document).ready(function(){
- $("#ajax-contact-form").submit(function(){
- var str = $(this).serialize();
- $.ajax({
- type: "POST",
- url: "contact.php",
- data: str,
- success: function(msg){
- $("#note").ajaxComplete(function(event, request, settings){
- if(msg == 'OK') // Message Sent? Show the 'Thank You' message and hide the form
- {
- result = '<div class="notification_ok">Your message has been sent. Thank you!</div>';
- $("#fields").hide();
- }
- else
- {
- result = msg;
- $("#fields").hide();
- }
- $(this).html(result);
- });
- }
- });
- return false;
- });
- });
- </script>
Add Comment
Please, Sign In to add comment