Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> radio i wylaczanie innych elementow form
warkakw
post
Post #1





Grupa: Zarejestrowani
Postów: 33
Pomógł: 0
Dołączył: 11.08.2006

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


witam

mam formularz na ktorym sa kolejno:

- pole typu radio
- pole typu file
- pole typu radio
- pole typu textbox

potrzebny mi skrypt ktory po wybraniu pierwszego radio zrobi file na odblokowany
a textbox na zablokowany(disabled) a po wybraniu drugiego radio odwrotnie.

probowalem z tym walczyc ale mi nie wychodzi.

thx za pomoc
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 2)
gekon
post
Post #2





Grupa: Zarejestrowani
Postów: 614
Pomógł: 7
Dołączył: 10.11.2003
Skąd: Rzeszów/Kraków

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


Z File nic nie zrobisz.
Go to the top of the page
+Quote Post
warkakw
post
Post #3





Grupa: Zarejestrowani
Postów: 33
Pomógł: 0
Dołączył: 11.08.2006

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


zrobie zrobie, juz zrobilem (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)

  1. function F_opcja(lp)
  2. {
  3. if (lp==1)
  4. {
  5. document.getElementById("skrypt").setAttribute("disabled","disabled");
  6. document.getElementById("www").setAttribute("disabled","disabled");
  7. document.getElementById("file").removeAttribute("disabled");
  8. }
  9.  
  10. if (lp==2)
  11. {
  12. document.getElementById("file").setAttribute("disabled","disabled");
  13. document.getElementById("skrypt").setAttribute("disabled","disabled");
  14. document.getElementById("www").removeAttribute("disabled");
  15. }
  16.  
  17. if (lp==3)
  18. {
  19. document.getElementById("file").setAttribute("disabled","disabled");
  20. document.getElementById("www").setAttribute("disabled","disabled");
  21. document.getElementById("skrypt").removeAttribute("disabled");
  22. }
  23. }


wywolanie:
<input name="radio" type="radio" value="1" onclick="F_opcja(1);">

pozdrawiam

Ten post edytował warkakw 5.09.2007, 18:21:06
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: 23.08.2025 - 06:36