467,893 Members | 1,905 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,893 developers. It's quick & easy.

Can only use one In-Line display/hide construct. Object err if > 1. Help please?

Hello,

I have a list of names, and when I click ona name I want the extar
info to show and then I want to clcik and hide it again.

I have the following HTML which works perfectly if I use one
construct, but if I use more that one it issues an object error which
states that: ExpCollTxt_ctrl_ex.style is not an object.

So the followin piece works fine:
<span>
<p class="mash2" id="ExpCollTxt_ctrl" style="DISPLAY: inline"><a
class="mash2" onclick="ExpCollTxt_ctrl.style.display='none';
ExpCollTxt_ctrl_ex.style.display='inline'; return false; "
href="#"><b>Shown List Item</b></a></p>
<p class="mash2" id="ExpCollTxt_ctrl_ex" style="DISPLAY:
none">Extended Info Upon Click
<a class="mash2" onclick="ExpCollTxt_ctrl_ex.style.display='none';
ExpCollTxt_ctrl.style.display='inline'; return false; " href="#">
<font size="2">Hide Extended Info</font></a></p>
<br />
</span>

However, if I put two of them together as below, I receive the stated
error:
<span>
<p class="mash2" id="ExpCollTxt_ctrl" style="DISPLAY: inline"><a
class="mash2" onclick="ExpCollTxt_ctrl.style.display='none';
ExpCollTxt_ctrl_ex.style.display='inline'; return false; "
href="#"><b>Shown List Item</b></a></p>
<p class="mash2" id="ExpCollTxt_ctrl_ex" style="DISPLAY:
none">Extended Info Upon Click
<a class="mash2" onclick="ExpCollTxt_ctrl_ex.style.display='none';
ExpCollTxt_ctrl.style.display='inline'; return false; " href="#">
<font size="2">Hide Extended Info</font></a></p>
<br />
</span>

<span>
<p class="mash2" id="ExpCollTxt_ctrl" style="DISPLAY: inline"><a
class="mash2" onclick="ExpCollTxt_ctrl.style.display='none';
ExpCollTxt_ctrl_ex.style.display='inline'; return false; "
href="#"><b>Shown List Item</b></a></p>
<p class="mash2" id="ExpCollTxt_ctrl_ex" style="DISPLAY:
none">Extended Info Upon Click
<a class="mash2" onclick="ExpCollTxt_ctrl_ex.style.display='none';
ExpCollTxt_ctrl.style.display='inline'; return false; " href="#">
<font size="2">Hide Extended Info</font></a></p>
<br />
</span>
Can anyone offer any help or suggestions as to what I'm may be doing
wrong, or if this is only supposed to work with one instance only??

Thank for your help in advance.

--FB
Jul 20 '05 #1
  • viewed: 2409
Share:
1 Reply
FrankBooth schrieb:
I have the following HTML which works perfectly if I use one
construct, but if I use more that one it issues an object error which
states that: ExpCollTxt_ctrl_ex.style is not an object.

However, if I put two of them together as below, I receive the stated
error:
<span>
<p class="mash2" id="ExpCollTxt_ctrl" style="DISPLAY: inline"><a <span>
<p class="mash2" id="ExpCollTxt_ctrl" style="DISPLAY: inline"><a

Can anyone offer any help or suggestions as to what I'm may be doing
wrong, or if this is only supposed to work with one instance only??


I have to admit that the javscript thingamajig is gobbledygooks to me.
But as far as HTML goes, the same id may only be used once per page.
This might confuse the script as well, since something like
onclick="ExpCollTxt_ctrl_ex.style.display='none'; would probably apply
to more than one element.
Matthias
Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Curious Expatriate | last post: by
5 posts views Thread by lawrence | last post: by
reply views Thread by Ben Eisenberg | last post: by
1 post views Thread by James | last post: by
1 post views Thread by lawrence | last post: by
3 posts views Thread by Quinten Carlson | last post: by
2 posts views Thread by Phillip Wu | last post: by
4 posts views Thread by Matt Schroeder | last post: by
3 posts views Thread by Wm | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.