select a cell in table row, return other cells in row

I have built a web page by reading a database in ASP and populating a table row with its contents. I have an input checkbox that when checked, I need to be able to read the input boxes for that row because I'll need to update a database in ASP because my client can update the information in the input text boxes.

I'm guessing that there is a way that when I figure out which input checkbox was selected, that I can read the other row elements.

Can someone give me a snippet of code - I'm thinking javascript might be the way to do this.

Thanks in advance.

LVL 13
samic400Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

radarshCommented:
Ummmmmm... can you post what you have done till now? I am not very clear on your question.

________
radarsh
Pravin AsarPrincipal Systems EngineerCommented:
Look at the getParent ()  and getChildren() usage in the example ..



<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>

<body>
<script language="javascript">
function getParent (src, tagName) {
      while (src.parentNode != null) {
            if (src.parentNode.tagName  == tagName) {
                  //alert (src.parentNode.id);
                  return src.parentNode;
            }
            src = src.parentNode;
      }
      return src;
}
function getChildern (obj, inputType) {
      if (!obj) { return; }
      for (var ix=0; ix < obj.childNodes.length; ix++) {
            var cObj = obj.childNodes[ix];
            if (!cObj.tagName) { continue; }
            if (cObj.childNodes.length) {
                  getChildern(cObj, inputType);
            }
            if (cObj.tagName == inputType) {
                  alert ('INPUT ' + cObj.name + ' TYPE ' + cObj.type);
            }
      }
}
</script>
<table>
<tr id='tr1'>
<td width="600"><input type="checkbox" name="chk1" onMouseOver="getChildern (getParent(this, 'TR'), 'INPUT');"></td>
<td width="600"><input type="checkbox" name="chk2"></td>
</tr>
</table>
</body>
</html>

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.