DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Craig Roberge Guest

    referencing a span id in javascript


    Hi,

    I'm trying to dynamically show and hide tablecells. The table cells are enclosed
    in span tags and are dynamically created using ASP. Using the onclick event
    of the span tag I call a function to hide and show cells,passing the span
    id to the function. Depending on the id other cells are either shown of hidden.

    I can change the current cell by passing 'this', and also any cells that
    were static in the page, but when it is dynamically created using ASP I get
    an error. The error says that the id of span, spanid.style.visibility, is
    not an object.

    How can I reference these dynamic span id's in javascript.

    Can anyone help.

    Thanks
    Craig

  2. #2
    John Cogan Guest

    Re: referencing a span id in javascript


    Hi

    I am not an expert but I am thinking that you should proberly use the collections
    array for span tags, if one exists... ?


    "Craig Roberge" <craigroberge@bigfoot.com> wrote:
    >
    >Hi,
    >
    >I'm trying to dynamically show and hide tablecells. The table cells are

    enclosed
    >in span tags and are dynamically created using ASP. Using the onclick event
    >of the span tag I call a function to hide and show cells,passing the span
    >id to the function. Depending on the id other cells are either shown of

    hidden.
    >
    >I can change the current cell by passing 'this', and also any cells that
    >were static in the page, but when it is dynamically created using ASP I

    get
    >an error. The error says that the id of span, spanid.style.visibility, is
    >not an object.
    >
    >How can I reference these dynamic span id's in javascript.
    >
    >Can anyone help.
    >
    >Thanks
    >Craig



Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links