Chciałbym, żeby input radio o nazwie act i wartości 2 robił się disabled i checked przechodziło automatycznie na act o wartości 1, gdy w polu select wybrana zostanie opcja a
Kawałek mam napisane:
<form name="f"> <SELECT NAME="select" onBlur="check()"> <OPTION SELECTED> <OPTION value="a">a <OPTION value="b">b </SELECT> <br> <input type="radio" name="act" value="1">active <br> <input type="radio" name="act" value="2">active/notactive </form> <script language="JavaScript"> <!-- function check(){ if(document.f.select.options[document.f.select.selectedIndex].value == "a"){ // co tu napisać? } } //--> </script>
ale nie wiem co wstawić w ramiona warunku. Podglądywałem inne skrypty, ale dla mnie nie jest to zrozumiałe i nie umiem sobie z tym poradzić

proszę o pomoc.
P.S. Jak robię tak:
<form name="f"> <SELECT NAME="select" onBlur="check()"> <OPTION SELECTED> <OPTION value="a">a <OPTION value="b">b </SELECT> <br> <input type="checkbox" name="act2" value="1"> </form> <script language="JavaScript"> <!-- function check(){ if(document.f.select.options[document.f.select.selectedIndex].value == "a"){ // co tu napisać? document.f.act2.disabled = true; } else{ document.f.act2.disabled = false; } } //--> </script>
to wszystko działa... ale mam problem z polami input o typie radio.
edit://
Już mam kod... temat nieaktualny. Faxe masta mi napisał (thx):
<html> <head> <script type="text/javascript"> function zdisableduj() { var wy; try { document.forms[0].foo[2].disabled = true; } catch( e ) { wy = ''; for( el in e ) wy += el +': '+ e[el] +'\n'; alert( wy ); } } </script> </head> <body> <form action="http://www.wp.pl/" method="get"> <label> <input type="radio" name="foo" value="bar" /> bar </label> <label> <input type="radio" name="foo" value="baz" /> baz </label> <label> <input type="radio" name="foo" value="spam" /> spam </label> <label> <input type="radio" name="foo" value="eggs" /> eggs </label> </form> <div style="border: 1px dashed red; cursor: pointer;" onclick="zdisableduj();"> Kliku-klik! (zdisableduje "spam") </div> </body> </html>