Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [HTML][JavaScript]Walidacja Checkboxa
bubus_s
post 31.08.2010, 17:17:01
Post #1





Grupa: Zarejestrowani
Postów: 83
Pomógł: 0
Dołączył: 15.06.2009
Skąd: Lublin

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


Witam.

Posiadam o to taki formularz z checkboxem
  1. <form name="subscribeform" class="cmxform" id="rej1" method="post" action="http://myweb.pl/skrypt.php">
  2. //formularz
  3.  
  4. //checkbox
  5. <input type="checkbox" class="checkbox" id="agree" name="agree" validate="required:true" />
  6. <br/>
  7.  
  8. Akceptuje <a href="http://myweb.pl/regulamin">regulamin</a> i <a href="http://myweb.pl/regulamin">polityke prywatnosci</a>
  9.  
  10. <label for="agree" class="error block">Zakceptuj Regulamin</label>
  11. </form>
  12.  


Do tego css:
  1. label{ width: 100px; float: left; }
  2. label.error { float: none; color: red; padding-left: 15px; vertical-align: top;}
  3. p { clear: both; }
  4. label.sprawdzony {float: none; background:url("sprawdzony.png") no-repeat 0px 0px; margin-left: 5px; padding-left: 10px;}


No i dorzućmy js
[JAVASCRIPT] pobierz, plaintext
  1. <script type="text/javascript">
  2.  
  3.  
  4. $.metadata.setType("attr", "validate");
  5.  
  6. $(document).ready(function() {
  7.  
  8. $("#rej1").validate();
  9.  
  10. });
  11. </script>
[JAVASCRIPT] pobierz, plaintext


Chce teraz dodać jeżeli checkbox będzie zaznaczony
wyświetlała się grafika taka fajeczka.
W css mam już to zrobione
Teraz do tego kodu js według mnie trzeba dodać jakąś klase czy coś.
Nie wiem jak to zrobić.
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 - 05:01