There are a number of obvious problems, let's start with them.
First, you are at no point calling the function
showTextField(). You need to
bind the function to the click event on your radio buttons.
Second,
mac1.style.display is referencing an undefined variable. Use
getElementById() to get a reference to the element:
document.getElementById('mac1').style.display.
Third this code, assuming that it was corrected as above, is first showing the element, then hiding it:
Do you want to show the element at this point, or hide it? Pick which one.
Fourth, although you're trying to set visibility through the
display CSS attribute, on your
mac1 element you're setting the
visibility attribute, so the element will be hidden irrespective of what you set
display to. Decide whether you want to use
visibility or
display and use them consistently.
Fifth, none of these things are defined anywhere in your code, so it's not clear what you're expecting to happen when you use them for comparisons or to set properties:
nodeinpTxtAreainpTxtBox
Overall, your code seems like a confused mish-mash. If you're not really sure what you're doing with JavaScript it may be easier to start with jQuery which has shortcuts for
click handling and
hiding and
showing elements.