i have given code for displaying an alert message if the textbox is left empty..
Code: Select all
function validate() {
if(document.form.year.value=="")
{
alert ('Please enter year');
return false;
}}it is working , but i want to do is..
it should display an alert message if the length of the numbers is less than 4 or greater than 4
how can i do that??
please give me a solution...
thanks......