Comparison from your code is wrong. Value needed for each variables. Below one is sample valid example.
if(UserID == "" && Password =="")
{
....
}
Sometime you need to other logical character. For example, above code is wrong in one way because fields like UserID and Password are mandatory so you have to use
OR
condition in validation.
if(UserID == "" || Password =="")
{
....
}
JavaScript Comparison and Logical Operators[
^]
Here few sample related to display error messages
Simple Javascript Validation without Alerts - Java Infinite[
^]
How to display error without alert box using JavaScript ? - GeeksforGeeks[
^]
Search Web for more samples.