View Full Version : walking the dom

01-03-2006, 09:35 PM
i have a div that has a table with form fields in it. i want to single out those fields and loop through them and validate their values. how would i do that?

document.getElementsByTagName would work, its just that it would pull every element with that tagname, i just want the ones in that div, and im only checking to see if they're blank.


<div id="container">
<input id="nameField">
<input id="siteField">

01-03-2006, 09:55 PM
got it

function validatex(){
var dom = document.getElementById('shout_form');
var dom2 = dom.getElementsByTagName('input');
for(var i = 0; i < dom2.length; i++){

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum