Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [JavaScript] Sprawdzanie input radio z różnymi nazwami i nieznaną ilością input radio
harbii
post 2.04.2014, 22:25:51
Post #1





Grupa: Zarejestrowani
Postów: 311
Pomógł: 1
Dołączył: 27.05.2006

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


Kolejny problem z formularzem.

  1. var xxx = -1;
  2. var stan = document.getElementById('formularz').stan
  3.  
  4. for (x=0; x<stan.length; x++) {
  5. if (stan[x].checked) {
  6. xxx = x;
  7. break;
  8. }
  9. }
  10. if (xxx == -1) {
  11. alert('Nie zaznaczyles żadnego pola!');
  12. }


Powyższy skrypt sprawdza input radio z name=stan

A jak sprawdzić nieznaną ilość radio'nów, które tworz się same w sposób:
stan1
stan2
stan3
stan4 itd ?



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 Wersja Lo-Fi Aktualny czas: 14.08.2025 - 06:45