Advertisement
Guest User

Asterixus

a guest
Oct 19th, 2012
22
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!DOCTYPE HTML>
  2. <html>
  3.     <head>    
  4.            
  5.         <title>Registrierung</title>    
  6.         <meta name="description" content="Registrierung">  
  7.        
  8.         <style type="text/css">
  9.             .no { color: red; font-size: 14px; }
  10.             .yes { color: #006600; font-size: 14px; }
  11.         </style>
  12.  
  13.  
  14.         <script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
  15.         <script type="text/javascript">
  16.         $(document).ready(function() {
  17.  
  18.             $("#username").blur(function() { // Wenn nicht mehr im Fokus
  19.  
  20.                 $("#messageUser").html('Benutzername wird überprüft...'); //Vor Ajax-Antwort
  21.  
  22.                 var form_data = {
  23.                     action: 'check_username',
  24.                     username: $(this).val()
  25.                 };
  26.  
  27.                 $.ajax({
  28.                     type: "POST",
  29.                     url: "functions.php",
  30.                     data: form_data,
  31.                     success: function(result) {
  32.                         $("#messageUser").html(result);
  33.                     }
  34.                 });
  35.  
  36.             });
  37.            
  38.            
  39.             $("#pw2").blur(function() { // Wenn nicht mehr im Fokus
  40.  
  41.                 $("#messagePass").html('Passwort wird überprüft...'); //Vor Ajax-Antwort
  42.  
  43.                 var form_data2 = {
  44.                     action: 'check_password',
  45.                     password1: $("#pw").val(),
  46.                     password2: $(this).val()
  47.                 };
  48.  
  49.                 $.ajax({
  50.                     type: "POST",
  51.                     url: "functions.php",
  52.                     data: form_data2,
  53.                     success: function(result) {
  54.                         $("#messagePass").html(result);
  55.                     }
  56.                 });
  57.  
  58.             });
  59.  
  60.         });
  61.         </script>
  62.     </head>
  63.     <body>  
  64.        
  65.        
  66. <body>
  67.  
  68.     <form method="post" name="form1" id="form1" action="">
  69.         <div>
  70.             Username:<br />
  71.             <input type="text" name="username" id="username" value="" autocomplete="off" />
  72.             <div id="messageUser"></div>
  73.         </div>
  74.         <div>
  75.             Passwort:<br />
  76.             <input type="password" name="pw" id="pw" value="" autocomplete="off" />
  77.         </div>
  78.         <div>
  79.             Passwort wiederholen:<br />
  80.             <input type="password" name="pw2" id="pw2" value="" autocomplete="off" />
  81.             <div id="messagePass"></div>
  82.         </div>
  83.            
  84.         <div>
  85.             <input type="button" id="button1" name="button1" value="submit" />
  86.         </div>
  87.     </form>
  88. </body>
  89.    
  90.    
  91.    
  92.  
  93. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement