Forum Moderators: open
function validate_forms()
{
for ( i = 0; i < document.forms.length; i++)
{
elements = document.forms[i]; for( n = 0; n < elements.length ; n++)
{
if ( elements[n].name == "req" && elements[n].value == "")
{
elements[n].focus();
return false;
}
}
}
return true;
}
span.style.display = "none";
For example, something like this would be optimal:
if elements[n].parentspan.style.display!= "none"
or
span.style.display = "none";
for ( i = 0; i < span.childNode.length ; i++)
span.childNode[i].display = "none"l;
Thanks in advance.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Untitled</title>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<script type="text/javascript">
function stepBack(targ){
while(targ.tagName.toUpperCase()!='HTML'){
if(targ.currentStyle){
disp_var=targ.currentStyle.display;
}else{
disp_var=window.getComputedStyle(targ, null).display;
}
alert(targ.tagName+'\n'+disp_var);
targ=targ.parentNode;
}
alert(targ.tagName+'\nthe end of line');
}
</script>
</head>
<body>
<div>
<div>
<h2><a href="#" onclick="stepBack(this);">test stepBack</a></h2>
</div>
</div>
</body>
</html>