dbotton
09-23-2002, 06:32 PM
Hi experts,
I am in front of a the next problem:
I build dynamically a kind of "menu" extracting from an access database user names from a user table. I want the final user to be able to click whatever of the menu entries (user names), for instance, "Francis" and then get expanded HTML code that reflects information about this user.
The function to expand is the next javascript code store in bbb.js
function Despliega(imagen)
{
var muestra;
muestra= document.forms[imagen].style.display;
document.forms[0].style.display='none';
document.forms[1].style.display='none';
document.forms[2].style.display='none';
document.forms[3].style.display='none';
document.forms[4].style.display='none';
document.forms[5].style.display='none';
document.forms[6].style.display='none';
document.forms[7].style.display='none';
if(muestra == 'none')
{
document.forms[imagen].style.display='';
}
else
{
document.forms[imagen].style.display='none';
}
}
How I call it is the next way more or less:
<SCRIPT type='text/javascript' src='bbb.js'></SCRIPT>
<A class=Gris style="TEXT-DECORATION:underline" href="javascript:Despliega(0);">
User: <%=recordSetusers("Firstname")%> <%=recordSetusers("Lastname")%>
</A>
<FORM style="display: none" name="menu">
<% response.write("<BR> HTML Code specific to that user using asp code calls also <BR>") %>
</FORM>
My problem is the next one:
I I have less than 9 users in the database (which means less than 9 calls to despliega function, then I get the next error:
"Error on Page."
The navegator details say:
"error: 'document.forms.8.style' is null or not an object"
I do not know how to avoid this problem
Please help...
Thanks
Best regards
I am in front of a the next problem:
I build dynamically a kind of "menu" extracting from an access database user names from a user table. I want the final user to be able to click whatever of the menu entries (user names), for instance, "Francis" and then get expanded HTML code that reflects information about this user.
The function to expand is the next javascript code store in bbb.js
function Despliega(imagen)
{
var muestra;
muestra= document.forms[imagen].style.display;
document.forms[0].style.display='none';
document.forms[1].style.display='none';
document.forms[2].style.display='none';
document.forms[3].style.display='none';
document.forms[4].style.display='none';
document.forms[5].style.display='none';
document.forms[6].style.display='none';
document.forms[7].style.display='none';
if(muestra == 'none')
{
document.forms[imagen].style.display='';
}
else
{
document.forms[imagen].style.display='none';
}
}
How I call it is the next way more or less:
<SCRIPT type='text/javascript' src='bbb.js'></SCRIPT>
<A class=Gris style="TEXT-DECORATION:underline" href="javascript:Despliega(0);">
User: <%=recordSetusers("Firstname")%> <%=recordSetusers("Lastname")%>
</A>
<FORM style="display: none" name="menu">
<% response.write("<BR> HTML Code specific to that user using asp code calls also <BR>") %>
</FORM>
My problem is the next one:
I I have less than 9 users in the database (which means less than 9 calls to despliega function, then I get the next error:
"Error on Page."
The navegator details say:
"error: 'document.forms.8.style' is null or not an object"
I do not know how to avoid this problem
Please help...
Thanks
Best regards