Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [js][html] weryfikacja chexboxów
poczatkujaca12
post
Post #1





Grupa: Zarejestrowani
Postów: 107
Pomógł: 0
Dołączył: 24.06.2010
Skąd: Warszawa

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


mam prosty skrypt
  1. function spr(){
  2. if(document.getElementById('s1').is(":checked") == true or document.getElementById('s2').is(":checked") == true or document.getElementById('s3').is(":checked") == true
  3. or document.getElementById('s4').is(":checked") == true or document.getElementById('s5').is(":checked") == true or document.getElementById('s6').is(":checked") == true)
  4. {
  5. return true;
  6. } else {
  7. document.getElementById('u').style.display = 'block';
  8. return false;
  9. }
  10. }

wywołuje to
  1. onclick="spr()"

moim celem jest aby sprawdzić czy chociaż 1 checkbox został zaznaczony jeśli tak wysyła formularz jeśli nie zwraca false i wyświetla uwagę...
wiem że skrypt jest błędny zwraca mi:
  1. Uncaught SyntaxError: Unexpected identifier

  1. Uncaught ReferenceError: spr is not defined
  2. at HTMLInputElement.onclick

o co chodzi?

Ewentualnie czy da się zrobić to prościej?
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 - 15:31