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
You should use var theForm = getElementById("theForm") instead of calling theForm directly. Only Chrome and IE adds the elements ids to the javascript global scope.
And you should use getAttribute() to get the value of an attribute because only IE has this shortcut.