The problem that I\'m having is that my code works fine in JavaScript but doesn\'t work correctly in Firefox or safari and wondering why. What I\'m doing is I have a loop going
I don't know asp tags. I assume req is a attribute so this should do what you asked by only alerting if the attributes are equal to your requirments, I use a shortcut array to hold all the found elements by tag name as James said its more crossbrowser.
var a = [];
a = document.getElementsByTagName("input");
for(var i=0; i < a.length; i++){
if (theForm.elements[i].getAttribute('type')== "text" && theForm.elements[i].getAttribute('req') == "yes" ){
alert("Made it here wtih" + theForm.elements[i])
}
}