Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> checkbox, błąd w zmianie klasy
Gitrix
post
Post #1





Grupa: Zarejestrowani
Postów: 49
Pomógł: 0
Dołączył: 17.10.2014

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


  1. (function(a){a.fn.customcheckbox=function(){return this.each(function(){obj=a(this);var b=obj.html();
  2. var c=obj.attr("name");var e="customcheckbox_"+c;var f="checkbox_"+c;var d='<a href="" class="checkbox" id="'+e+'"><small></small>
  3. </a>';obj.after(d);obj.attr("id",f);if(obj.attr("checked")){a("a#"+e).addClass("on")}else{a("a#"+e).addClass("off")}a("a#"+e).click(function()
  4. {var g=a(this);if(g.hasClass("on")){g.find("small").stop().animate({left:23});g.removeClass("on").addClass("off");a("input#"+f).removeAttr("checked")}else{
  5. g.find("small").stop().animate({left:0});g.removeClass("off").addClass("on");a("input#"+f).attr("checked","checked")}return false})})}})(jQuery);

Problem w tym,że jeśli ustawie na "on" i klikne submit wyświetla się strona.pl/?checkbox=on
a jeśli ustawie na off nic się nie wyswietla

Link do całego kodu
http://ingitre.netai.net/Admin/js/global.js

Ten post edytował Gitrix 4.12.2014, 18:00:41
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
Gitrix
post
Post #2





Grupa: Zarejestrowani
Postów: 49
Pomógł: 0
Dołączył: 17.10.2014

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


  1. <a href="" class="checkbox" id="

jak wynika z kodu samo się ustawia id,a więc html nie ma tu nic do tego
Go to the top of the page
+Quote Post

Posty w temacie


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: 7.10.2025 - 12:45