Guest User

Untitled

a guest
Jul 21st, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 2.79 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3.     <head>
  4.         <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  5.         <title>koło</title>
  6.     </head>
  7.     <body>
  8.         <script type="text/javascript">
  9. // <![CDATA[
  10. function sprawdz(formularz)
  11. {
  12.     for (i = 0; i < formularz.length; i++)
  13.     {
  14.         var pole = formularz.elements[i];
  15.         if (!pole.disabled && !pole.readonly && (pole.type == "text") && pole.value == "")
  16.         {
  17.             alert("Proszę wypełnić wszystkie pola!");
  18.             return false;
  19.         }
  20.     }
  21.     return true;
  22. }
  23. // ]]>
  24. function validation()
  25.     {
  26.         var reW = /[0-9]{2,3}/;                                // cyfry od 0 do 9, zakres : dziesietny lub setny, mozna zapisac : \d{2,3}, wiek
  27.        
  28.          else if (!reW.test(document.getElementById('wiek').value))
  29.             {
  30.             alert('Nieprawidlowy wiek');
  31.             return false;
  32.             }
  33. </script>
  34.  
  35.    
  36.         <form action="plik.php" method="post" enctype="text/plain" onsubmit="if (sprawdz(this)) return true; return false"><div>
  37.                
  38.        
  39.         <input type="text" name="imie" />Imię <br />
  40.         <input type="text" name="nazwisko" /> Nazwisko <br />
  41.        
  42.         <select name="wydzial">
  43.             <option value="WMiI">Wydział matematyki i informatyki</option>
  44.             <option value="WNT">Wydział nauk technicznych</option>
  45.             <option value="WNS">Wydział nauk społecznych</option>
  46.             <option value="WNE">Wydział nauk ekonomicznych</option>
  47.             <option value="WNH">Wydział nauk humanistycznych</option>
  48.            
  49.         </select><br />
  50.         <input type="radio" name="Płeć" value="Kobieta" />Kobieta
  51.         <input type="radio" name="Płeć" value="Mężczyzna" />Mężczyzna
  52.         <br />
  53.         <input type="text" name="wiek" maxlenght="2" /> Wiek <br />
  54.        
  55.         <input type="checkbox" name="zainteresowania" value="komputery" />komputery<br />
  56.         <input type="checkbox" name="zainteresowania" value="pilka nożna" />Piłka nożna<br />
  57.         <input type="checkbox" name="zainteresowania" value="rower" />Rower<br />
  58.         <input type="checkbox" name="zainteresowania" value="pływanie" />pływanie<br />
  59.         <input type="checkbox" name="zainteresowania" value="gry" />gry<br />
  60.         <input type="checkbox" name="zainteresowania" value="spacery" />kspacery<br />
  61.         <input type="checkbox" name="zainteresowania" value="astronomia" />astronomia<br />
  62.         <input type="checkbox" name="zainteresowania" value="gastronomia" />gastronomia<br />
  63.         <input type="checkbox" name="zainteresowania" value="anime" />anime<br />
  64.         <input type="checkbox" name="zainteresowania" value="zdrowie" />zdrowie<br />
  65.        
  66.         <input type="submit" name="submit" value="wyślij" />
  67.         </form>
  68.  
  69.  
  70.     </body>
  71. </html>
Add Comment
Please, Sign In to add comment