Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <script type="text/javascript">
- function sprawdz() {
- var formularz=document.getElementById("f");
- wzory= {
- 'nazwisko': /^[A-Z]{1}[a-ząćęłńśźżó]+[\s]{1} [A-Z]{1}[a-ząćęłńśźżó]+$/,
- 'nip': /^[0-9]{3}-[0-9]{3}-[0-9]{2}-[0-9]{2}$/
- }
- //walidacja pol formularza ;P
- if(formularz['nazwisko'])
- {
- if(wzory['nazwisko'].test(formularz['nazwisko'].value))
- {
- formularz['nazwisko'].stylebackgroundColor="";
- }
- else
- {
- alert("wprowadziłeś błędne dane debilu pierdolony!");
- formularz['nazwisko'].stylebackgroundColor="red";
- return false;
- }
- }
- if(formularz['nip'])
- {
- if(wzory['nip'].test(formularz['nip'].value))
- {
- formularz['nip'].stylebackgroundColor="";
- }
- else
- {
- alert("wprowadziłeś błędne dane debilu pierdolony!");
- formularz['nip'].stylebackgroundColor="red";
- return false;
- }
- }
- }
- alert("Pola sa git!")
- return true;
- </script>
- </head>
- <body>
- <form action="mailto:gnomekxd11@gmail.com" method="post" enctype="text/plain" id="f" onsubmit="return sprawdz();">
- <h1>DANE OSOBOWEeeijeoiwqjewqe</h1>
- Imie i nazwisko:
- <input type="text" id="nazwisko" /><br><br>
- NIP:
- <input type="text" id="nip"><br><br>
- <input type="submit" id="wyslij">
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement