Code:
<option value="-select">Select</option> <script type="text/javascript">
var YearList = 5; // Specify number of "year" selections.
var year = new Date().getFullYear();
var pryr1 = year-2;
var pryr = year-1;
document.write('<option value="' + pryr1 + '">' + pryr1 + '</option>');
document.write('<option value="' + pryr + '">' + pryr + '</option>');
for(var i=0;i<YearList;i++){
var curyr = year + i;
document.write('<option value="' + curyr + '">' + curyr + '</option>');
}
</script>
2013
2014
2015
2016
2017
2018
2019
if i select any year over here and update the page, the value in the drop down box comes and again to "select"
i want the year which i selected to be shown
Comment