Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [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
woxala123
post
Post #2





Grupa: Zarejestrowani
Postów: 361
Pomógł: 12
Dołączył: 9.01.2010

Ostrzeżenie: (10%)
X----


http://stackoverflow.com/questions/2326941...king-a-checkbox
Go to the top of the page
+Quote Post

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

 



RSS Aktualny czas: 22.08.2025 - 17:46