Click to See Complete Forum and Search --> : 'ShowContent("<%=rs("id")%>")'


micmic2
07-01-2003, 02:28 PM
****
<script language=javascript>
function ShowContent(MessageID)
{
if (document.all[MessageID].style.display == "none")
document.all[MessageID].style.display = "";
else
document.all[MessageID].style.display = "none"
}
</script>
<a style='cursor:hand' onclick='ShowContent("MessageID5561")'><u>help</u></a>
<br> <span id="MessageID5561" style="display:none;">
message<BR></span>
****
this works
but...

****
<a style='cursor:hand' onclick='ShowContent("<%=rs("id")%>")'> <u>help</ u></a>
<br> <span id="<%=rs("id")%>" style="display:none;">help<BR></span>
****
but this doesn't works
what can i do
I think that when i write
'ShowContent("<%=rs("id")%>")'
the function doesn't recognize ("<%=rs("id")%>") as an object

chrismartz
07-03-2003, 01:59 PM
why don't you just use a server-side function to do this function. I don't believe Javascript can recognize server-side tags

micmic2
07-04-2003, 10:57 AM
it does recognize the server-side tags because when i wrote
document.write(MessageID) it worked
but it doesn't recognize it as an object

how do i write it in server-side function
how do i translate
document.all[MessageID].style.display
to a server-side code?

micmic2
07-05-2003, 03:05 PM
I didn't understand your suggestion
I can't use a variable because I want to do it in a loop
and i need a differenet id-name (variable) to a differenet item