Link to home
Start Free TrialLog in
Avatar of SquishyD
SquishyD

asked on

Object expected

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>
Avatar of jaysolomon
jaysolomon

Are you wanting to just expand/collaspe a <div>?
Avatar of SquishyD

ASKER

Yes that's right.
Yes that's right.
Yes that's right.
Sorry for the multiple posts. Did not mean that. I am dynamically assigning DIV Id's here.
ASKER CERTIFIED SOLUTION
Avatar of jaysolomon
jaysolomon

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Which line is giving you the "object expected" error?
Argh I found it. It's the line that states:
<a href="javascript:doNothing()">
That stupid method was moved on me! Anyways thanks everyone.
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:
https://www.experts-exchange.com/help/closing.jsp


Cd&

Looks like SquishyD solved it himself... did any of the  questions / comments from experts help you SquishyD?
agree with kasandra ;)
thanks jay ;)
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