Show/hide table rows -- parameter undefined error?

Discussion in 'Javascript' started by KathyB, Sep 29, 2003.

  1. KathyB

    KathyB Guest

    Hi, I'm trying to get the following script to work, but I'm getting an
    error saying "rowID is undefined".

    function showhide(rowId) {
    var showRow = "Edit_" + rowID
    var hideRow = "View_" + rowID
    document.getElementById(showRow).style.display ="block";
    document.getElementById(hideRow).style.display = "none";
    }

    I'm building the html using an xsl stylesheet, so I'm passing a
    dynamic name attribute as the rowID parameter. When I look at the HTML
    source, it looks fine. Please tell me where I'm going wrong...I'm sure
    it's simple, just not to me! Thanks, Kathy

    Here is a sample of the row source:

    <tr id="View_Label" bgcolor="red" valign="middle"
    style="display:block">
    <td width="70%"><h3>1. Label</h3></td>
    <td width="30%">
    <input type="button" name="Edit" value="Edit"
    onclick="showhide('Label')"></td>
    </tr>

    ....then another row with ="Edit_Label" is used for the input boxes,
    etc.
     
    KathyB, Sep 29, 2003
    #1
    1. Advertising

  2. KathyB

    kaeli Guest

    In article <>,
    enlightened us with...
    > Hi, I'm trying to get the following script to work, but I'm getting an
    > error saying "rowID is undefined".
    >


    Case-sensitive.

    > function showhide(rowId) {
    > var showRow = "Edit_" + rowID <-- rowId not rowID


    -------------------------------------------------
    ~kaeli~
    All I ask for is the chance to prove that money
    cannot make me happy.
    http://www.ipwebdesign.net/wildAtHeart
    http://www.ipwebdesign.net/kaelisSpace
    -------------------------------------------------
     
    kaeli, Sep 29, 2003
    #2
    1. Advertising

  3. KathyB

    Kathy Burke Guest

    ugh. can't believe I didn't see that. thanks!

    Kathy

    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    Kathy Burke, Sep 29, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. RA
    Replies:
    1
    Views:
    4,055
  2. JDP@Work

    Show Hide Table(s), Rows & Cells w/out a postback

    JDP@Work, Apr 20, 2006, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    217
    JDP@Work
    Apr 20, 2006
  3. Harry

    Dynamically Show/Hide table rows?

    Harry, Sep 3, 2003, in forum: Javascript
    Replies:
    3
    Views:
    416
    Vjekoslav Begovic
    Sep 3, 2003
  4. Mark

    Show / Hide Table Rows

    Mark, Oct 20, 2003, in forum: Javascript
    Replies:
    2
    Views:
    200
    Louise Woodward
    Oct 23, 2003
  5. Hide/Show Table Rows

    , Feb 10, 2006, in forum: Javascript
    Replies:
    3
    Views:
    235
Loading...

Share This Page