i hv problem which: i have 2 radio button with value 'yes' and 'no' and one textbox, my question is : default the texbox is disabled and when user choose radio button "yes" the texbox become enabled...

anyone can help me?
thanks

There are many ways to do that but I'd rather use this method

<script language ="javascript>
<!--
function whatever()
{  
     var TextBoxName = document.FormName.TextBoxName.disabled = true;
     var radioButtonNameYes = false;
     var radioButtonNameNo = false;
     if(document.nameOftheForm.radioButtonName(yes).checked)
     {
        radioButtonName = true;     
        document.FormName.textBoxName.disabled=false;
        document.FormName.textBoxname.value = " ";
     } else 
            {
               //do the "No" radio button
            }

}
//-->

</script>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.