Validating SELECT Boxes in JavaScript
Thursday, October 21st, 2004One of the more boring tasks in DHTML is validation of form data and specifically of INPUT and SELECT boxes. Since both have a ".value" property, we can save time and use the same code for checking both: if(selectBox.value == null || selectBox.value.length == 0) { alert('Nothing selected in select box!'); } else ...