Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Object expected

Posted on 2003-03-25
13
Medium Priority
?
284 Views
Last Modified: 2011-09-20
Hi everyone,

Ths following code segment outputs multiple lines each beginning with "Expand". When you click on the "Expand" link, it expands/collapses a DIV section containing further text. Ultimately, you would have 4 lines such as this that could all be expanded/collapsed in such a manner. The code works in that the appropriate section will expand/collapse, but for some reason, I continue to get a javascript error stating "Object Expected" and I don't know why. Any help would be greatly appreciated. Thanks.

<script language="JavaScript">
function showDivSection(div) {
   div.style.display='';
}
               
function hideDivSections(div) {
   div.style.display='none';
}
                         
function ExpandCollapse(div) {
   if (div.style.display == '') {
      hideDivSections(div);
}
else if (div.style.display == 'none'){
   showDivSection(div);
   }
}              
</script>    

<xsl:param name="position"><xsl:value-of select="position()"/></xsl:param>
         
<tr class="title">
  <td colspan="1">
  <a href="javascript:doNothing()">
    <xsl:attribute name="onClick">ExpandCollapse(document.getElementById('<xsl:value-of select="xalan:evaluate($position)"/>'));</xsl:attribute>
  Expand
  </a>
  Locale Information (<xsl:value-of select="om:Name"/>)
  </td>
  <td>
    <input type="checkbox">Host input complete</input>
  </td>
</tr>
<tr>
  <td>
    <div>
      <xsl:attribute name="id"><xsl:value-of select="xalan:evaluate($position)"/></xsl:attribute>    
      <xsl:call-template name="LM"/>
      <br/>                                  
    </div>
  </td>
</tr>
0
Comment
Question by:SquishyD
  • 5
  • 3
  • 3
  • +2
13 Comments
 
LVL 16

Expert Comment

by:jaysolomon
ID: 8206223
Are you wanting to just expand/collaspe a <div>?
0
 

Author Comment

by:SquishyD
ID: 8206251
Yes that's right.
0
 

Author Comment

by:SquishyD
ID: 8206259
Yes that's right.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:SquishyD
ID: 8206260
Yes that's right.
0
 

Author Comment

by:SquishyD
ID: 8206271
Sorry for the multiple posts. Did not mean that. I am dynamically assigning DIV Id's here.
0
 
LVL 16

Accepted Solution

by:
jaysolomon earned 75 total points
ID: 8206342
Try this. It isn't xsl but...

It is an example i had in my ''tool box''

<html>
<head>
<title>Table Example</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="Javascript">
<!--
function render(c, t) {
if (c.checked) {
 document.getElementById(t).style.display="block"
} else {
 document.getElementById(t).style.display="none"
}
}
//-->
</script>

</head>

<body bgcolor="#FFFFFF" text="#000000">
<table width="29%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td height="16">
      <input type="checkbox" name="checkbox" value="checkbox" onClick="render(this, 'tblTest1')">
      Q: How Do I Blah Blah Blah</td>
  </tr>
</table>
<table id="tblTest1" style="display:none" width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#CCCCCC">
  <tr>
    <td>
      <blockquote>
        <p>A: BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAHBLAH
          BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH
          BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH
          BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH
          BLAH BLAH BLAH BLAH BLAH </p>
        </blockquote>
    </td>
  </tr>
</table>
<table width="30%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td>
      <input type="checkbox" name="checkbox2" value="checkbox" onClick="render(this, 'tblTest2')">
      Q: How Do I Blah Blah Blah</td>
  </tr>
</table>
<table id="tblTest2" style="display:none" width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#CCCCCC">
  <tr>
    <td><blockquote>
        <p>A: BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAHBLAH
          BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH
          BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH
          BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH
          BLAH BLAH BLAH BLAH BLAH </p>
        </blockquote></td>
  </tr>
</table>
<table width="30%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td>
      <input type="checkbox" name="checkbox22" value="checkbox" onClick="render(this, 'tblTest3')">
      Q: How Do I Blah Blah Blah</td>
  </tr>
</table>
<table id="tblTest3" style="display:none" width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#CCCCCC">
  <tr>
    <td><blockquote>
        <p>A: BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAHBLAH
          BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH
          BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH
          BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH
          BLAH BLAH BLAH BLAH BLAH </p>
        </blockquote> </td>
  </tr>
</table>
<table width="30%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td>
      <input type="checkbox" name="checkbox222" value="checkbox" onClick="render(this, 'tblTest4')">
      Q: How Do I Blah Blah Blah</td>
  </tr>
</table>
<table id="tblTest4" style="display:none" width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#CCCCCC">
  <tr>
    <td><blockquote>
        <p>A: BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAHBLAH
          BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH
          BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH
          BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH
          BLAH BLAH BLAH BLAH BLAH </p>
        </blockquote> </td>
  </tr>
</table>
<table width="30%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td>
      <input type="checkbox" name="checkbox2222" value="checkbox" onClick="render(this, 'tblTest5')">
      Q: How Do I Blah Blah Blah</td>
  </tr>
</table>
<table id="tblTest5" style="display:none" width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#CCCCCC">
  <tr>
    <td><blockquote>
        <p>A: BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAHBLAH
          BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH
          BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH
          BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH
          BLAH BLAH BLAH BLAH BLAH </p>
        </blockquote></td>
  </tr>
</table>
</body>
</html>
0
 
LVL 5

Expert Comment

by:kasandra
ID: 8207704
Which line is giving you the "object expected" error?
0
 

Author Comment

by:SquishyD
ID: 8207726
Argh I found it. It's the line that states:
<a href="javascript:doNothing()">
That stupid method was moved on me! Anyways thanks everyone.
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 9115285
This question has been classified abandoned. I will make a recommendation to the
moderators on its resolution in a week or two. I appreciate any comments
that would help me to make a recommendation.

<note>
Unless it is clear to me that the question has been answered I will recommend delete.  It is possible that a Grade less than A will be given if no expert makes a case for an A grade. It is assumed that any participant not responding to this request is no longer interested in its final disposition.
</note>

If the user does not know how to close the question, the options are here:
http://www.experts-exchange.com/help/closing.jsp


Cd&

0
 
LVL 5

Expert Comment

by:kasandra
ID: 9119061
Looks like SquishyD solved it himself... did any of the  questions / comments from experts help you SquishyD?
0
 
LVL 16

Expert Comment

by:jaysolomon
ID: 9122128
agree with kasandra ;)
0
 
LVL 5

Expert Comment

by:kasandra
ID: 9126612
thanks jay ;)
0
 
LVL 6

Expert Comment

by:Programming_Gal
ID: 9656043
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Accept jaysolomon's comment as answer

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Programming_Gal
EE Cleanup Volunteer
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preface In the first article: A Better Website Login System (http://www.experts-exchange.com/A_2902.html) I introduced the EE Collaborative Login System and its intended purpose. In this article I will discuss some of the design consideratio…
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses

571 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question