By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,850 Members | 967 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,850 IT Pros & Developers. It's quick & easy.

Show/hide table rows -- parameter undefined error?

P: n/a
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.
Jul 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
In article <75**************************@posting.google.com >,
Ka**********@attbi.com 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
-------------------------------------------------
Jul 20 '05 #2

P: n/a
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!
Jul 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.