JS validation loop breaks form?
It works fine in Firefox and Chrome, but in IE the form does not show. I think because there's a problem with the JS validation function "checkAll" just before the form on line 113:
var obj = document.forms[formObj];
//alert(obj.name + " " + obj.length);
for (i=0; i<obj.length; i++)
if ((obj[i].value == "") & (obj[i].type != "hidden"))
//alert("Name: " + obj[i].name + ", Type: " + obj[i].type);
alert("Please enter a value for all fields.");
Can any one suggest why this does not work in IE?
(I'm using a loop because I have several forms with many fields and I want to test them all.)
Not sure if it's the actual problem but try changing your "&" with "&&". A single ampersand is used for bitwise comparison, while two is for normal logical comparison.
true && false == false
0101 & 0011 == 0001
Last edited by ReFreezed; 10-23-2012 at 10:48 AM.
Thanks, have changed & to && and nothing changed.
Any other suggestions please?
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)