Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <title>Document</title>
- <script src="../assets/jquery-1.8.3.min.js"></script>
- <script type="text/javascript">
- $(function() {
- $(".submit_button").click(function() {
- var textval = $("#xval").val();
- var x = 'xval='+ textval;
- var textcontent = $("#content").val();
- var y = 'content='+ textcontent;
- // $("#flash").show();
- // $("#flash").fadeIn().html('<span class="load">Loading..</span>');
- $.ajax({
- type: "POST",
- url: "action.php",
- data: y,
- cache: true,
- success: function(html){
- $("#show").after(html);
- document.getElementById('content').value='';
- document.getElementById('xval').value='';
- alert('Data Saved');
- // $("#flash").hide();
- // $("#xval").focus();
- // $("#content").focus();
- }
- });
- return false;
- });
- });
- </script>
- </head>
- <body>
- <div class="container">
- <div class="main">
- <form method="post" name="form" action="">
- <textarea style="width:500px; font-size:14px; height:60px; font-weight:bold; resize:none;" name="content" id="content" ></textarea><br />
- <textarea style="width:500px; font-size:14px; height:60px; font-weight:bold; resize:none;" name="xval" id="xval" ></textarea><br />
- <input type="submit" value="Post" name="submit" class="submit_button"/>
- </form>
- </div>
- <div class="space"></div>
- <div id="flash"></div>
- <div id="show"></div>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement