472,807 Members | 1,750 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,807 software developers and data experts.

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
1 2618
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Curious Expatriate | last post by:
Hi- I'm completely stumped. I'm trying to write some code that will parse a file and rewrite it with all URLs replaced by something else. For example: if the file looks like this: <b>click...
5
by: lawrence | last post by:
I've waited 6 weeks for an answer to my other question and still no luck, so let me rephrase the question. I know I can do this: <form method="post" action="$self"> <input type="text"...
0
by: Ben Eisenberg | last post by:
I'm trying to run a php script setuid. I've tried POSIX_setuid but you have to be root to run this. The files are located on a public access unix system and have me as the owner and nobody as the...
1
by: James | last post by:
What is the best way to update a record in a MYSQL DB using a FORM and PHP ? Where ID = $ID ! Any examples or URLS ? Thanks
1
by: phpkid | last post by:
Howdy I've been given conflicting answers about search engines picking up urls like: http://mysite.com/index.php?var1=1&var2=2&var3=3 Do search engines pick up these urls? I've been considering...
1
by: lawrence | last post by:
What is the PHP equivalent of messaging, as in Java?
3
by: Quinten Carlson | last post by:
Is there a way to conditionally define a function in php? I'm trying to run a php page 10 times using the include statement, but I get an error because my function is already defined. The docs...
2
by: Phillip Wu | last post by:
Hi, I saw a previous post about sending arrays but did not quite understand the answers. The problem is that I would like to pass an entire array as a hidden input field from one php script...
4
by: Matt Schroeder | last post by:
Does anyone know how to count how many rows are in a mysql table? This is what I have, but it doesn't work right: <? $db = mysql_connect("localhost", "username", "password");...
3
by: Wm | last post by:
I have a table of users in mySQL that appears to have a lot of duplicates. What's the best way to look at the userID and email and delete the duplicates? Thanx, Wm
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
How does React native implement an English player?
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.