function doesn't always work ?

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
garyed
Forum Newbie
Posts: 13
Joined: Fri Feb 20, 2009 6:45 pm

function doesn't always work ?

Post 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
Post Reply