What this script is doing is creating a list of anchors that put the focus back on the input element of the form element that is not valid. What I don't understand is what this [1] part of the script is referring to:

newa.appendChild(document.createTextNode(txt));
newa.href='#'+f.id;
newa.onclick=function()
{
var loc=this.href.match(/#(\w.+)/)[1];
document.getElementById(loc).focus();
return false;
}

Thanks in advance for any help on this.