function check(f) {

  // pola text
  if ((f.pesel.value.length>1)&&(f.regon.value.length>1)) { alert("Wypełnij tylko jedno z pól: PESEL lub REGON."); return false; }
  return true;
}

//sprawdź pola cyfrowe
function sprcyfry() {
  if (document.form1.pesel.value.match(/\D/)) {alert("Pole Pesel może zawierać tylko cyfry!."); return false;}
  if (document.form1.numerds.value.match(/\D/)) {alert("Pole Numer Dowodu os może zawierać tylko cyfry!."); return false;}
  if (document.form1.regon.value.match(/\D/)) {alert("Pole Regon może zawierać tylko cyfry!."); return false;}
  //if (document.form1.telea.value.match(/\D/)) {alert("Pole Telefon może zawierać tylko cyfry!."); return false;}
  if (document.form1.kkoda.value.match(/\D/)) {alert("Pole Kod Pocztowy może zawierać tylko cyfry!."); return false;}
  if (document.form1.kkodb.value.match(/\D/)) {alert("Pole Kod Pocztowy może zawierać tylko cyfry!."); return false;}
  if (document.form1.koda.value.match(/\D/)) {alert("Pole Kod Pocztowy może zawierać tylko cyfry!."); return false;}
  if (document.form1.kodb.value.match(/\D/)) {alert("Pole Kod Pocztowy może zawierać tylko cyfry!."); return false;}
  return true;
}
