//use === or == for condition checking in javascript./ if(document.getElementById('name').value === ""){ alert("enter something valid"); return false; }