Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <script type="text/javascript"
- src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
- <link rel="stylesheet" type="text/css" media="all" href="style-modal.css">
- <link rel="stylesheet" type="text/css" media="all" href="fancybox/jquery.fancybox.css">
- <script type="text/javascript" src="fancybox/jquery.fancybox.js?v=2.0.6"></script>
- <script type ="text/javascript" src="like2.js"></script>
- <title></title>
- <script type="text/javascript">
- $(document).ready(function() {
- $(".load").load('show.php');
- function validateEmail(email) {
- var reg = /^(([^<>()[]\.,;:s@"]+(.[^<>()[]\.,;:s@"]+)*)|(".+"))@(([[0-9
- {1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}])|(([a-zA-Z-0-9]+.)+[a-zA-Z]{2,}))$/;
- return reg.test(email);
- }
- $(".modalbox").fancybox();
- $("#contact").submit(function() { return false; });
- $("#send").on("click", function(){
- var emailval = $("#email").val();
- var commentid = $("#commentid").val();
- alert("clicked!");
- var mailvalid = validateEmail(emailval);
- if(mailvalid == false) {
- $("#email").addClass("error");
- }
- else if(mailvalid == true){
- $("#email").removeClass("error");
- }
- if(mailvalid == true) {
- $("#send").replaceWith("<em>Sending...</em>");
- $.ajax({
- type: 'POST',
- url: 'sendmessage.php',
- data: $("#contact").serialize(),
- success: function(data) {
- if(data == "true") {
- $("#contact").fadeOut("fast", function(){
- $(this).before("<p><strong>Success! Your feedback has been sent, thanks :)</strong
- </p>");
- setTimeout("$.fancybox.close()", 1000);
- });
- }
- }
- });
- }
- });
- });
- </script>
- </head>
- <body>
- <div class="load">
- </div>
- </body>
- </html>
- <?php
- include('connect.php');
- echo '<div class="load">
- <button class="modalbox" href="#inline">Click</button>
- </div>
- <div id="inline">
- <h3>Enter your email to receive updates</h3>
- <form id="contact" name="contact" action="#" method="post">
- <label for="email">Your E-mail</label>
- <input type="email" id="email" name="email" class="txt">
- <input type="hidden" id="commentid" name="commentid" value="5">
- <br>
- <button id="send">Send E-mail</button>
- </form>
- </div>
- </div>';
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement