What type of form input should the user expect to give null in javascript?
I'm not sure if my question is clear enough, but consider the following function:
function validateForm() {
var x = document.forms["myForm"]["fname"].value;
if (x == null || x == "") {
alert("First name must be filled out");
return false;
}
}
What I don't get is "null"; I understand that the blank line "" indicates that nothing was entered, but what type of input would the user have to enter that would mean null
?
+3
source to share