add all the imgs checkboxes and divs. based on which checkbox is selected set their visibility to hidden or visibile
the following code has divs with report names inside them. based on which report the user selects, it either shows or hides the User textbox
Code:
// SHOW / HIDE USER INPUTS
function select() {
//alert(document.values.description.selectedIndex);
var desc = "<%= Request.querystring("description") %>";
if (desc == "faxes_sent")
{
document.getElementById("userid1").style.visibility = "visible";
document.getElementById("userid2").style.visibility = "visible";
}
else if (desc == "md_nb_count")
{
document.getElementById("userid1").style.visibility = "hidden";
document.getElementById("userid2").style.visibility = "hidden";
}
}
Code:
<tr>
<td rowspan=5>
<div id=faxes_sent onmouseover=highlight("faxes_sent") onmouseout=highlight("faxes_sent") style="background-color:#ffffcc"
onclick=window.location="<%= request.servervariables("URL") %>?description=faxes_sent">Faxes Sent</div>
<div id=md_nb_count onmouseover=highlight("md_nb_count") onmouseout=highlight("md_nb_count") style="background-color:#ffffcc"
onclick=window.location="<%= request.servervariables("URL") %>?description=md_nb_count">MD NB Count</div>
</td>
</tr>
<tr>
<td rowspan=5>  </td>
</tr>
<tr>
<td><div id="start1" STYLE="visibility:visible">Start Date</div></td>
<td><div id="start2" STYLE="visibility:visible"><input type="text" size=10 maxlength=8 name=start value=
<%= request.querystring("start") %>></div></td>
<td><div id="start3" STYLE="visibility:visible">YYYYMMDD</div></td>
</tr></div>
<tr>
<td><div id="end1" STYLE="visibility:visible">End Date</div></td>
<td><div id="end2" STYLE="visibility:visible"><input type="text" size=10 maxlength=8 name=end value=
<%= request.querystring("end") %>></div></td>
<td><div id="end3" STYLE="visibility:visible">YYYYMMDD</div></td>
</tr></div>
<tr>
<td><div id="userid1" STYLE="visibility:visible">Userid</div></td>
<td><div id="userid2" STYLE="visibility:visible">
<% 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><OPTION VALUE=PICK>PICK USER</OPTION><option value=NULL>UNASSIGNED</OPTION>"
do until srs.eof
response.write "<option>" & srs.fields("loginname") & "</option>"
srs.movenext
loop
response.write "</select>"
end if %>
</td></div>
</tr>
edit - hmmm, this example is a asp script. the select function is run onload. clicking the div redirects the page to ?description=*whatever*. based on which description is found, the select function shows/hides the divs.
Code:
<body onload="WindowLoad();document.values.start.focus();select();">