Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [js] walidacja radio
agataperz
post
Post #1





Grupa: Zarejestrowani
Postów: 182
Pomógł: 0
Dołączył: 24.03.2009
Skąd: Hamburg DE

Ostrzeżenie: (0%)
-----


Witam,

mam taki skrypt
  1. function checkradio(){
  2. var radio=false;
  3. for (var i=0; i<document.formularz.length; i++){
  4. if (document.formularz.elements[i].type == "radio"){
  5. var x = document.formularz.elements[document.formularz.elements[i].name].length;
  6. for (var y=0; y<x; y++){
  7. if (document.formularz.elements[i+y].checked) break;
  8. }
  9. if (y == x){
  10. return false;
  11. } else radio=true;
  12. i = i+x-1;
  13. } else radio=true;
  14. }
  15. return radio;
  16. }


oraz

  1. <form name="formularz" action="finalizacja.php" method="post" onsubmit="return sprawdz(this);return checkradio(this)">


funkcja sprawdz działa poprawie - sprawdza pola input text
niestety funkcja checkradio nie chce działać. możecie mi powiedzieć co jest źle?
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 21.08.2025 - 05:58