Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> radio i wylaczanie innych elementow form
warkakw
post 4.09.2007, 18:14:13
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
gekon
post 5.09.2007, 07:38:22
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.


--------------------
Pokaż kod = Pokaż CAŁY kod, najlepiej działający na jakimś serwerze.
Fanatycy | glazar.info | semantyka | HTML i XHTML FAQ
Go to the top of the page
+Quote Post
warkakw
post 5.09.2007, 18:20:27
Post #3





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

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


zrobie zrobie, juz zrobilem 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
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 1.07.2025 - 23:49