onemli Posted March 2, 2010 Share Posted March 2, 2010 Merhaba Arkadaşlar Benim Bir Sorunum Var Şimdi Bir Form Hazırlıyorum Bu Formda 2 Tane Radio BUtton 1 Tane Metin Kutusu Olacak Radio Buttonlardan Biri Seçildiğinde Metin Kutusu Aktif Olmayacak Diğeri Seçildiğinde Aktif Olacak İnternette Bir Örnek Buldum Ama Oda İstediğim Gibi Çalışmadı. Aşağıdaki Kod Belki Tam Olarak Ne İstediğimi Anlatmama Yardımcı Olabilir Şimdiden Teşekür Ediyorum ... <form action=""> <table border="1" width="100%"> <tr> <td colspan="2"> <p align="right"><input type="radio" value="V1" checked name="R1">Seçili Durumdayken Metin Kutusu Aktif Olmayacak</td> <td width="653"><input type="radio" name="R1" value="V2">Seçili Durumdayken Metin Kutusu Aktif Olacak</td> </tr> <tr> <td>Metin Kutusu</td> <td> <p align="center">:</td> <td width="653"><input type="text" name="T1" size="20" disabled="disabled"></td> </tr> </table> </form> Link to comment Share on other sites More sharing options...
saydax Posted March 3, 2010 Share Posted March 3, 2010 <html> <script type="text/javascript"><!-- if(document.all && !document.getElementById) { //IE4 support document.getElementById = function(id) { return document.all[id]; } } function dss_addLoadEvent(fn) { if(typeof(fn)!="function")return; var tempFunc=window.onload; window.onload=function() { if(typeof(tempFunc)=="function")tempFunc(); fn(); } } dss_addLoadEvent(function() { if(!document.getElementById) return; var f = document.getElementById('form1'); // to prevent the form from submitting in this demo f.onsubmit = function(){ return false; } // hide the textarea and its parent label document.getElementById('demo_radio_ta_label').style.display = 'none'; // get a reference to the radio button group var rads = f.elements['demo_radio']; for(var i=0;i<rads.length;i++) { // we add the event handler to each button in the group rads[i].onkeyup=rads[i].onclick=function(){ if(!this.checked) return; var el = document.getElementById('demo_radio_ta_label'); el.style.display = (this.value=="yes")?'':'none'; } // in case, for any reason, one of the radio buttons is already checked rads[i].onclick(); } }); // --> </script> </head> <body> <p id="toCategoryIndex"> </p> <div id="wrapper"> <form id="form1" action="#"> <fieldset class="radio"> <legend>denem</legend> <label for="rad1"><input type="radio" name="demo_radio" id="rad1" value="yes" > açık</label> <br> <label for="rad2"><input type="radio" name="demo_radio" id="rad2" value="no" > kapalı</label> </fieldset> <div class="label" id="demo_radio_ta_label"><label ></label> <textarea name="explanation" cols="48" rows="6"></textarea></div> </form> </div> </body> </html>[/CODE] buyur kardeş Link to comment Share on other sites More sharing options...
onemli Posted March 3, 2010 Author Share Posted March 3, 2010 Kardeşim Çok Teşekür Ederim Aradığımı Buldum <script> function pasif() { document.getElementById("mk1").disabled=true; } function aktif() { document.getElementById("mk1").disabled=false; } </script> <form action=""> <table border="1" width="100%"> <tr> <td colspan="2"> <input type="radio" value="V1" checked name="R1" id="rb1" onclick="pasif();">Seçili Durumdayken Metin Kutusu Aktif Olmayacak</td> <td width="653"><input type="radio" name="R1" value="V2" id="rb2" onclick="aktif();">Seçili Durumdayken Metin Kutusu Aktif Olacak</td> </tr> <tr> <td>Metin Kutusu</td> <td> </td> <td width="653"><input type="text" name="T1" size="20" disabled="disabled" id="mk1"></td> </tr> </table> </form> Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.