![]() |
![]() |
![]()
Post
#1
|
|
Grupa: Zarejestrowani Postów: 256 Pomógł: 7 Dołączył: 1.01.2005 Ostrzeżenie: (0%) ![]() ![]() |
Mam 5 inputów o id='g5'. Czy da się je wszystkie zablokować naraz? Zrobiłem coś takiego
Kod function acc(group) { val = document.getElementById(group).disabled; if(val == true) { document.getElementById(group).disabled=false; } else { document.getElementById(group).disabled=true; } } Ale po wywołaniu funkcji Cytat acc("g5") blokuje się tylko pierwszy input (IMG:http://forum.php.pl/style_emoticons/default/sad.gif)
|
|
|
![]() |
![]()
Post
#2
|
|
Grupa: Zarejestrowani Postów: 130 Pomógł: 1 Dołączył: 29.06.2007 Ostrzeżenie: (0%) ![]() ![]() |
Kod function acc(it) { val = it.disabled; if(val == true) { it.disabled=false; } else { it.disabled=true; } } i przekazuj przez funkcje referencje do 'this' (mozna wywalic id), jeśli nie możesz operować na 'this' bo odwolujesz sie do innego węzła to możesz zrobić klase i odwolywac sie przez getElementsByClassName zamiast getElementById Ten post edytował flv 30.06.2007, 18:06:00 |
|
|
![]() ![]() |
![]() |
Aktualny czas: 11.10.2025 - 03:59 |