Advertisement
Guest User

Untitled

a guest
Mar 19th, 2019
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. function resetForm() {
  2. document.getElementById("form1").reset();
  3. }
  4.  
  5. function validateForm() {
  6. let x = load('carPlate');
  7. if (x == "") {
  8. alert("Uzupelnij wszystkie pola nicponiu!");
  9. return false;
  10. }
  11.  
  12. x =load('carModel');
  13. if(x==""){
  14. alert("Uzupelnij wszystkie pola nicponiu!");
  15. return false;
  16. }
  17.  
  18. x = load('yearOfTransaction');
  19. if(x==""){
  20. alert("Uzupelnij wszystkie pola nicponiu!");
  21. return false;
  22. }
  23.  
  24. //baza danych
  25. }
  26.  
  27. // function check() {
  28. // let x = document.getElementsById("yearOfTransaction");
  29. // alert(x.value);
  30. // if(x.value < 1950){
  31. // x.setAttribute("value", "1950");
  32. // }
  33. // else if (x.value > 2019){
  34. // x.setAttribute("value", "2019");
  35. // }
  36. // }
  37.  
  38.  
  39. function load(name) {
  40. let variable;
  41. variable = document.getElementById(name).value;
  42. return variable;
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement