By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,851 Members | 1,118 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,851 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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.