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
Use getAttribute to read the custom attributes. See http://jsfiddle.net/8EWQr/.
So instead of
(theForm.elements[a].type == "text" && theForm.elements[a].req == "yes")
use
(theForm.elements[a].getAttribute('type') == "text" && theForm.elements[a].getAttribute('req') == "yes")