Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <title></title>
- <script type="text/javascript">
- //var nowe_wyr = /^[0-9] +[a-z]+$/;
- text = "cat dog";
- reg = /cat/;
- if (reg.test(text)) document.write("Tekst znajduje się");
- else document.write("Tekst nie znajduje się")
- function Sprawdz_d(form)
- {
- text = document.getElementById('pesel').value =='')
- reg = /[0-9]{11};
- if (reg.test(text)) document.write("Tekst znajduje się");
- else alert("Zly pesel")
- {
- alert('Pole pesel musi byc wypelnione')
- form.pesel.focus();
- return false;
- }
- return true;
- if (document.getElementById('nazw').value.length <3)
- {
- alert('Pole Nazwisko musi zawierac co najmniej trzy znaki')
- form.nazw.focus();
- return false;
- }
- if (document.getElementById('imie').value.length <2)
- {
- alert('Pole Imie musi zawierac co najmniej dwa znaki')
- form.imie.focus();
- return false;
- }
- if (document.getElementById('zawod').value =='')
- {
- alert('Pole Zawod musi byc wypelnione')
- form.zawod.focus();
- return false;
- }
- return true;
- }
- </script>
- </head>
- <body>
- <style type="text/css">
- div{
- width: 400px;
- background-color: #dff;
- }
- .pole {
- position: absolute;
- left: 90px;
- }
- </style>
- </head>
- <body bgcolor="#dfdfdf">
- <div>
- <form enctype="text/plain" action="mailto:darthjanek1999@gmail.com" method="post" onsubmit='return Sprawdz_d(this);'>
- <p>Dane osobowe:</p> <br> <br>
- <p>Pesel:</p>
- <input class="pole" name="pesel" value="" size="40" id='pesel'> <br> <br>
- <p>Nazwisko:</p>
- <input class="pole" name="nazw" value="" size="40" id='nazw'> <br> <br>
- <p>Imie:</p>
- <input class="pole" name="imie" value="" size="40" id='imie'> <br> <br>
- <p>Zawod:</p>
- <input class="pole" name="zawod" value="" size="40" id='zawod'> <br> <br>
- <label>Pracuje <input type="checkbox" name="opcje" maxlength="1"> </label> <br> <br>
- <input type="submit" name="Wyslij" value="Wyślij" maxlength="20">
- </form>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement