Page 1 of 1

function doesn't always work ?

Posted: Fri Oct 22, 2010 8:43 pm
by garyed
This function works on all three of my computers in Linux & Windows , Firefox , Seamonkey & IE but on some other computers it doesn't :
function check_form()
{
var check = true;
if ((document.theload.location.value == "")|| (document.getElementById('city').value==""))
{
alert ('You need to select a Location;');
check = false;
}
return check;
}
On some computers the variable check returns true when an option is selected from a drop down menu & on others it returns false when the same option is selected. If I only use the the first condition in the if statement then it works correctly on all the computers but when I use the first condition or the second condition in the if statement it doesn't always work. I assume there's something ambiguous in the if statement but I can't figure it out.
Any ideas welcome