Advertisement
Guest User

Untitled

a guest
Mar 14th, 2018
251
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 2.45 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3.   <head>
  4.     <meta charset="utf-8">
  5.     <title></title>
  6.     <script type="text/javascript">
  7.       //var nowe_wyr = /^[0-9] +[a-z]+$/;
  8.       text = "cat dog";
  9.       reg = /cat/;
  10.       if (reg.test(text)) document.write("Tekst znajduje się");
  11.       else document.write("Tekst nie znajduje się")
  12.  
  13.       function Sprawdz_d(form)
  14.        {
  15.          text = document.getElementById('pesel').value =='')
  16.          reg = /[0-9]{11};
  17.          if (reg.test(text)) document.write("Tekst znajduje się");
  18.          else alert("Zly pesel")
  19.          {
  20.            alert('Pole pesel musi byc wypelnione')
  21.            form.pesel.focus();
  22.            return false;
  23.          }
  24.          return true;
  25.  
  26.  
  27.         if (document.getElementById('nazw').value.length <3)
  28.        {
  29.          alert('Pole Nazwisko musi zawierac co najmniej trzy znaki')
  30.          form.nazw.focus();
  31.          return false;
  32.        }
  33.        if (document.getElementById('imie').value.length <2)
  34.        {
  35.          alert('Pole Imie musi zawierac co najmniej dwa znaki')
  36.          form.imie.focus();
  37.          return false;
  38.        }
  39.        if (document.getElementById('zawod').value =='')
  40.        {
  41.          alert('Pole Zawod musi byc wypelnione')
  42.          form.zawod.focus();
  43.          return false;
  44.        }
  45.        return true;
  46.      }
  47.  
  48.    </script>
  49.   </head>
  50.   <body>
  51.  
  52.         <style type="text/css">
  53.           div{
  54.             width: 400px;
  55.             background-color: #dff;
  56.           }
  57.  
  58.           .pole {
  59.             position: absolute;
  60.             left: 90px;
  61.           }
  62.  
  63.         </style>
  64.       </head>
  65.       <body bgcolor="#dfdfdf">
  66.  
  67.     <div>
  68.       <form enctype="text/plain" action="mailto:darthjanek1999@gmail.com" method="post" onsubmit='return Sprawdz_d(this);'>
  69.         <p>Dane osobowe:</p> <br> <br>
  70.         <p>Pesel:</p>
  71.         <input class="pole" name="pesel" value="" size="40" id='pesel'> <br> <br>
  72.         <p>Nazwisko:</p>
  73.         <input class="pole" name="nazw" value="" size="40" id='nazw'> <br> <br>
  74.         <p>Imie:</p>
  75.         <input class="pole" name="imie" value="" size="40" id='imie'> <br> <br>
  76.         <p>Zawod:</p>
  77.         <input class="pole" name="zawod" value="" size="40" id='zawod'> <br> <br>
  78.         <label>Pracuje <input type="checkbox" name="opcje" maxlength="1"> </label> <br> <br>
  79.  
  80.         <input type="submit" name="Wyslij" value="Wyślij" maxlength="20">
  81.  
  82.       </form>
  83.     </div>
  84.  
  85.   </body>
  86. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement