Thank you to everyone who is able to help me up front.....
I am building the front-end web interface for a warehouse inventory system for my company owner. I have a page with (2) Radio Buttons. The first radio button is set to make a single text field appear and the second radio button is set to make the first text field as well as (9) more text fields appear. This section is for adding MAC addresses into the inventory with the same shipping information for all the MAC addresses. I only need to know how to make the Text Fields go from "Visibility:Hidden" to "Visible" when either of the Radio Buttons are selected. I'm utilizing Div tags for just about everything to keep the page organized. Any help getting this Script to work is appreciated.
Joined: Nov 26, 2012
Paul Clapham wrote:Hi Brad, welcome to the Ranch!
Thank You kindly for the clarification, I apologize for the confusion on my end. The HTML I can provide but the Scripting isn't any good......I've been scrapping what I could from the internet and nothing has been working. I think it would be quite confusing if I posted my code with my CSS but I will do so if it clarifies. I know that my Var settings aren't correct but I was trying everything before I posted on here.
Joined: Nov 26, 2012
Here is my newest code revision......It still does not make the text field visibility change......Any help would be appreciated......
Second, mac1.style.display is referencing an undefined variable. Use getElementById() to get a reference to the element:
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: