<!DOCTYPE html>
<html>
<head>
<script>
$(document).ready(function()
{
$('#year').blur(function()
{
var yearRegExp = /^[0-9]+$/;
var v_year=$("#year").val();
if (v_year=="") //not working in o/p
{
$("#year").css({"border":"1px solid red"});
$("#year_error").text("you can't Leave This Empty!");
$("#year_error").css({"margin-top":"5px"});
}
else if (!yearRegExp.test(v_year)) //not working in o/p
{
$("#year").css({"border":"1px solid red"});
$("#year_error").text("Please Enter Numeric Values Only");
$("#year_error").css({"margin-top":"5px"});
}
else if (v_year.length != 4) //not working in o/p
{
$("#year").css({"border":"1px solid red"});
$("#year_error").text("Year is not proper. Please check");
$("#year_error").css({"margin-top":"5px"});
}
var current_year=new Date().getFullYear();
if ((v_year < 1920) || (v_year > current_year)) / not /working in o/p
{
$("#year").css({"border":"1px solid red"});
$("#year_error").text("Year should be in range 1929 to current year");
$("#year_error").css({"margin-top":"5px"});
} }
else
{
$("#year").css({"border":"1px solid grey"});
$("#year_error").text("");
$("#year_error").css({"margin-top":"0px"});
return false;
}
});
});
</script>
</head>
<body>
<div id="wrapper">
<form id="eg" action="/">
<div id = "form_name">
<div>
<label class="label">Year</label></div>
<input type="text" name="year" id="year" class="input_year" placeholder="Year" maxlength="4" required>
<span class='error_text' id='year_error'></span>
</div>
</div>
</form>
</div>
</body>
</html>
i need each statement will execute on browser
if u have tried solved this problem
thank u in advanced.............