joris

Form Lengkap

Mar 28th, 2012
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 4.03 KB | None | 0 0
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  5. <meta name="viewport" content="width=device-width,height=device-height,user-scalable=no,initial-scale=1.0">
  6. <title>Online News Application</title>
  7. <link rel="stylesheet" href="css/style_acc.css" type="text/css" />
  8. <link rel="stylesheet" href="css/fb-buttons.css">
  9. <link href="css/fb-1.css" rel="stylesheet" type="text/css" />
  10. <link href="css/fb-3.css" rel="stylesheet" type="text/css" />
  11. <link href="css/jquery.alerts.css" rel="stylesheet" type="text/css" />
  12.  
  13.         <script src="js/jquery-1.7.1.min.js"></script>
  14.         <script src="js/jquery.mobile-1.1.0.min.js"></script>
  15.         <script src="js/jquery.alerts.js"></script>
  16.        
  17. <script language="javascript">
  18.     function CekLogin(){
  19.         $(document).ready(function(){
  20.         $("#login").submit( function (){
  21.         $.ajax({
  22.                type: "POST",
  23.                url : 'http://www.berthojoris.com/dev/jqm/login_cek.php',
  24.                data: {
  25.                   username:$('#username').val(),
  26.                   password:$('#password').val(),
  27.                },
  28.                dataType: "json",
  29.                success: function (data) {
  30.                     if (data.response=='SuksesLogin') {
  31.                         jAlert('Login Successfully', 'Success');
  32.                     } else {
  33.                         jAlert('Login Failed', 'Fail');
  34.                     }
  35.                 }
  36.       });
  37.     });
  38. });
  39. }    
  40.    
  41.     function validateForm(){
  42.           var CekNama=document.forms["komentar"]["nama"].value;
  43.           if (CekNama==""){
  44.              jAlert('Nama anda belum dimasukan', 'Follow Rules');
  45.              return false;
  46.              }
  47.     }
  48.    
  49.     function ClearForm(){
  50.         document.forms["login"]["username"].value = ""
  51.         document.forms["login"]["password"].value = ""
  52.     }
  53.  
  54. </script>
  55.  
  56. </head>
  57. <body style="background-color:#e6eae9">
  58.  <div class="uibutton-toolbar" style="background-color:#FFF;text-align:center">
  59.                 <a class="uibutton confirm" rel="external" href="index.html">Home</a>
  60.                 <a class="uibutton confirm" rel="external" href="news_list.html">Online News</a>
  61.                 <a class="uibutton confirm" rel="external" href="report.html">Report Application</a>
  62.                 <a class="uibutton confirm" rel="external" href="about.html">About Application</a>
  63.                 <a class="uibutton special" rel="external" href="login.html">Login</a>
  64. </div>
  65.            
  66.            
  67.            
  68. <ul class="acc" id="acc" >
  69.     <li>
  70.                         <h3>Login Form</h3>
  71.                         <div class="acc-section_hitam">
  72.  
  73.                             <div class="acc-content_hitam">
  74.                                 <div class="section">
  75.        <p>Silahkan masukan username dan password untuk mendapatkan akses ke menu administrator. Aplikasi akan memeriksa data anda.</p>
  76.         <br />
  77.         <div id="message_ajax"></div>
  78.        
  79.         <form name="login" method="post">
  80.         <table id="mytable" style="width:425px;">
  81.  
  82.   <tr>
  83.     <td width="141" style="text-align:right">Username</td>
  84.     <td width="10">:</td>
  85.     <td width="258"><input name="username" type="text"  class="inputtext" id="username" ></td>
  86.   </tr>
  87.  
  88.   <tr>
  89.     <td class="alt" style="text-align:right">Password</td>
  90.     <td width="10">:</td>
  91.     <td class="alt"><input name="password" type="password"  class="inputtext" id="password" ></td>
  92.   </tr>
  93.  
  94.   <tr>
  95.     <td class="alt"></td>
  96.     <td class="alt"></td>
  97.     <td class="alt">
  98.     <input style="width:74px;" class="uibutton confirm" id="submit" onClick="CekLogin();" value="Login">
  99.     <input style="width:74px;" class="uibutton" onClick="resetForm();" value="Reset" >
  100.     </td>
  101.   </tr>
  102.  
  103. </table>
  104. </form>
  105.         </div>
  106.         <br />
  107.        
  108.             <div class="uibutton-toolbar">
  109.               Created By : Bertho Joris
  110.             </div>
  111.         </div>
  112.     </div>
  113.                             </div>
  114.                         </div>
  115.                     </li>
  116. </ul>
  117.  
  118. </body>
  119. </html>
Advertisement
Add Comment
Please, Sign In to add comment