Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [JavaScript] Problem pod IE
-ciekawwwski-
post
Post #1





Goście







Witam serdecznie.

Napisałem ostatnio prosty kod aktywujący bądź dezaktywujący inputy w formularzu w zależności od tego w jaki radiobutton się kliknie:

  1. function pole(pole){
  2.  
  3. if(pole == "karta"){
  4. var element_1 = document.getElementById("termin");
  5. var element_2 = document.getElementById("data_przelewu");
  6. var element_3 = document.getElementById("kwota");
  7.  
  8. element_1.setAttribute('disabled', 'disabled');
  9. element_2.setAttribute('disabled', 'disabled');
  10. element_3.removeAttribute('disabled');
  11.  
  12. }
  13. if(pole == "przelew"){
  14. var element_1 = document.getElementById("termin");
  15. var element_2 = document.getElementById("data_przelewu");
  16. var element_3 = document.getElementById("kwota");
  17.  
  18. element_1.removeAttribute('disabled');
  19. element_2.removeAttribute('disabled');
  20. element_3.removeAttribute('disabled');
  21. }
  22. if(pole == "gotowka"){
  23. var element_1 = document.getElementById("termin");
  24. var element_2 = document.getElementById("data_przelewu");
  25. var element_3 = document.getElementById("kwota");
  26.  
  27. element_1.setAttribute('disabled', 'disabled');
  28. element_2.setAttribute('disabled', 'disabled');
  29. element_3.removeAttribute('disabled');
  30. }
  31.  
  32. }


Na innych przeglądarkach wszystko jest ok, niestety pod IE nie działa. Jak mogę to poprawić?
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 1)
skowron-line
post
Post #2





Grupa: Zarejestrowani
Postów: 4 340
Pomógł: 542
Dołączył: 15.01.2006
Skąd: Olsztyn/Warszawa

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


Z tego co pamiętam do IE ma chyba problem z removeAttribute, a i pomyśl o DRY


--------------------
I'm so fast that last night I turned off the light switch in my hotel room and was in bed before the room was dark - Muhammad Ali.
Peg jeżeli chcesz uprawiać sex to dzieci muszą wyjść, a jeżeli chcesz żeby był dobry ty też musisz wyjść - Al Bundy.

QueryBuilder, Mootools.net, bbcradio1::MistaJam
http://www.phpbench.com/
Go to the top of the page
+Quote Post

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 - 13:05