i want to check if values of a form is empty or not? i am trying to write my own validator after many validators like jquery.ketchup.0.3.2 failed me (or maybe i failed them ) but i cant make this function to work.
function validate() {
alert("hmmm");
var inputs = document.forms["register"].getElementsByTagName("input");
for (var item in inputs) {
if(item.value.trim() == "")
alert("nullField");
}
}
would you please tell me what is wrong with the above function?