Click to See Complete Forum and Search --> : too much recursion


mlecho
02-05-2008, 05:44 PM
i am making a form validation script..i have to loop through each input field to check for simply length...however when i do this, i get errors (from firefox) that there is too much recursion....why? and how can i fix this?

function checkLongFields()
{

var inps=document.getElementsByTagName("input");
for(var i=0;i<inps.length;i++)
{
var field=inps[i];
if(inps[i].type=="text" && inps[i].value.length<=0)
{
var marker=field.id;
error.style.display="block"
setAstrx(marker)
}
}
}
function setAstrx(id)
{

var astMatch=document.getElementById("a_"+id);
astMatch.style.display="block"

}

mlecho
02-05-2008, 05:52 PM
oops- cause in some cases the astMatch element does not exist...solved...sorry to bother you all

mlecho
02-05-2008, 06:11 PM
ohoh...i am back...could there be another reason?