Show/hide table rows -- parameter undefined error?

K

KathyB

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.
 
K

kaeli

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
-------------------------------------------------
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top