dojo validation

This is a dojo validation loop. Send it an array of input ids (with dojoTypes), and it will ensure they’re valid.

Code

function checkValid(aValid)
{
        var i,e;
        for (i=0;i<aValid.length;i++)
        {
                e=dojo.byId(aValid[i]);
                if (!e.readOnly)
                {
                        e=dijit.byId(aValid[i]);
                        if (typeof e.isValid != 'undefined')
                                if (!e.isValid())
                                {
                                        alert(e.invalidMessage);
                                        e.focus();
                                        return false;
                                }
                }
        }
        return true;
}
</script>

PS - Visit http://dojotoolkit.org with FireFox, not IE