![]() |
Dropdown onchange to view DIVs - requesting help
Hey guys,
I believe this falls under DOM so I'm posing here, if not, mods, feel free to move. I built/maintain an intranet web site where I work that houses all our call centers support docs and troubleshooting info. We are looking to open it up not just to our support staff but certain sections to our general employees and select customers. Ive done HTML for years, but havent touched JS since an intro course in college about 8 years ago. End result that I am trying for is a dropdown box that is set to a blank selection. When you select the Help Request option it will display the Help Div with the Help request form. When you select the Feedback option is will hide the Help Div and show the Feedback DIV. When you select the blank option, it will hide both. Any help would be greatly appreciated!!!!! Here is the code I have: Code:
<select name="select_form" id="select_form" onchange="select()"> |
This is a little simpler code:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
Man, you rock!!!
So it looks like I was over complicating it - which I tend to do pretty regularly. Your right it is much simpler and more importantly, it actually works! I see I also had a foul up with the if portion of the statement with the last bit being another "else if" where it should have just been an "else". Thanks so much Sunfighter!!!! |
Dear Sunfighter,
I tried to use your nice coding to my own coding, but it is not working properly. If you can, please take a look at my coding and give me a hint. Thank you very much in advance!! PHP Code:
|
The most significant errors are that you haven't opened your table tags. Make sure, also, that they only contain table elements (tr, etc.), with other elements nested within these.
You are also repeating at least one id-number; they must be unique on the page. I assume that you have a DOCTYPE declararation and opening html tag? |
An alternative using arrays:
Code:
function find_select() { |
| All times are GMT +1. The time now is 05:12 AM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.