home hardware prices news articles forums photos user reviews
Go Back   Tech Support Forums - TechIMO.com > PC Hardware and Tech > Webmastering and Programming
Ask a Tech Support Question (free)!

drop down selection show/hide divs

Reply
Get bargains at  »  Dealighted.com
 
Thread Tools Search this Thread
Currently Active Users: 2103
Discussions: 200,919, Posts: 2,379,061, Members: 246,287
Old January 17th, 2006, 04:33 PM   Digg it!   #1 (permalink)
Member
 
Join Date: Jun 2004
Location: south jersey, USA
Posts: 103
Send a message via ICQ to csamuels Send a message via AIM to csamuels Send a message via Yahoo to csamuels
drop down selection show/hide divs

i have one drop down listed first with report names. Below this drop down i have two textbox inputs and a asp generated drop down list. Each report should have its own definition for which inputs to show. I dont care what the other inputs are cus i wont be using them.

I having problems trying to have the script recognize whats selected in the report drop down (description). the window alert displays undefined when i pick form the list.

Code:
<script>
function select()
{

window.alert(document.values.description.selectedindex);

if (document.values.description.selectedindex == 0)
{
document.getElementById(start).style.visibility = "visible";
document.getElementById(end).style.visibility = "visible";
document.getElementById(userid).style.visibility = "visible";
}
else if (document.values.description.selectedindex == 1)
{
document.getElementById(start).style.visibility = "visible";
document.getElementById(end).style.visibility = "visible";
document.getElementById(userid).style.visibility = "hidden";
}
else
{
document.getElementById(start).style.visibility = "hidden";
document.getElementById(end).style.visibility = "hidden";
document.getElementById(userid).style.visibility = "hidden";
}
}</script>

<body OnLoad="document.values.start.focus();">
<form name=values action=" <%= request.servervariables("URL") %>" action="post">
<div id="report" STYLE="visibility:visible;">
<select name=description onchange="select();">
<option>Faxes Sent</option>
<option>Alissa</option>
</select></div>
<table><tbody>
<div id="start" STYLE="visibility:hidden;"><tr>
  <td>Start Date</td>
  <td><input type="text" name=start value=<%= request.form("start") %>></td>
  <td>YYYYMMDD</td>
</tr></div>
<div id="end" STYLE="visibility:hidden;"><tr>
  <td>End Date</td>
  <td><input type="text" name=end value=<%= request.form("end") %>></td>
  <td>YYYYMMDD</td>
</tr></div>
<div id="userid" STYLE="visibility:hidden;">
<tr>
  <td>Userid</td>
  <td><% query = "select loginname from irsysusers where isgroup = 0 and status = 12 order by loginname"
         srs.open query, sconn
         if srs.eof then 
           response.write "NO USERS FOUND IN DATABASE, CONTACT SYSTEMS DEPT"
         else 
           response.write "<select name=user>"
           do until srs.eof 
             response.write "<option>" & srs.fields("loginname") & "</option>" 
             srs.movenext 
           loop
           response.write "</select>" 
         end if %>
</tr></div>
</tbody></table><br>
<input type=hidden name=action value=exe>
<input type=submit value="Create Report"></form>
csamuels is offline   Reply With Quote
Old January 18th, 2006, 05:55 PM     #2 (permalink)
Banned
 
Iturea's Avatar
 
Join Date: Jan 2004
Location: Earth
Posts: 420
The one thing I see off the bat is:

You are using getElementById but you only have names defined like: name=start

you need to define the id=start as well....
Iturea is offline   Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I hide my IP? deathangel2005 Networking and Internet 20 August 23rd, 2005 11:54 PM
Show/Hide Tag's -FMA Suggestion Box 23 May 14th, 2005 01:00 PM
This chaps my hide...! jynxedu IMO Community 18 March 1st, 2004 01:02 PM
How do I hide or delete...? DanGrease Applications and Operating Systems 10 March 1st, 2004 12:54 PM
hide ip kyokusanaki Networking and Internet 7 January 12th, 2004 09:31 AM


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Most Active Discussions
Is It Just Me? (2849)
Obama the Muslim (12)
Why is Khalid Sheikh Mohammed even .. (9)
Is the PSU I received dead? (10)
windows vista security holes (7)
Foreign voltage (10)
HIS HD5770 graphic card question (15)
Install XP pro and a Vista laptop ?.. (9)
Print spooler problem (12)
Dept. of HS: NSA 'Helped' Develop V.. (15)
A good PSU? (10)
New Computer wont recognize XP disc (7)
Ideal cheap graph card for PC-Gamin.. (15)
EVGA 9800 gtx help with finding a g.. (8)
Recent Discussions
Print spooler problem (12)
Display shows 3x5 inch in middle of s.. (2)
[F@H SPAM 11/16/09] ! 1/2 months to r.. (33)
World's largest Monopoly Game using G.. (331)
Foreign voltage (10)
FiOS modem/router interfering with ne.. (7)
Browsers wont load websites (2)
Virus Doctor Popup? (1)
Help getting around port 80 for camer.. (1)
Dept. of HS: NSA 'Helped' Develop Vis.. (15)
windows vista security holes (7)
Install XP pro and a Vista laptop ?? (9)
EVGA 9800 gtx help with finding a goo.. (8)
Modern Warfare For the PC (32)
Problem with speed step/turbo boost? (1)
monitor will not turn on at all, (0)
Modern Warfare 2: Who Bought It? (61)
SIS 740 and Widescreen (8)
Baffling Problem with my CPU/MoBo's. .. (0)
HIS HD5770 graphic card question (15)
Best file format to play on Windows H.. (0)
PSP Go bought in Japan (0)
Asus P4G8X Mobo (3)
Need hard disk drivers (4)
windows 7 internet problem (4)


All times are GMT -4. The time now is 07:24 PM.
TechIMO Copyright 2009 All Enthusiast, Inc.



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28