D
David
I have a form on my asp page with 3 dropdowns, day, month & year, but
for some reason, the day dropdown is displaying the 25th twice, instead
of 26th, then 27th ?
I have this script in the <head> of my asp page:
_____________________
<script type="text/javascript">
var
monthtext=['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sept','Oct','Nov','Dec'];
function populatedropdown(dayfield, monthfield, yearfield){
var today=new Date()
var dayfield=document.getElementById(dayfield)
var monthfield=document.getElementById(monthfield)
var yearfield=document.getElementById(yearfield)
for (var i=0; i<31; i++)
dayfield.options=new Option(i+1, i+1)
dayfield.options[today.getDate()]=new Option(today.getDate(),
today.getDate(), true, true) //select today's day
for (var m=0; m<12; m++)
monthfield.options[m]=new Option(monthtext[m], monthtext[m])
monthfield.options[today.getMonth()]=new
Option(monthtext[today.getMonth()], monthtext[today.getMonth()], true,
true) //select today's month
var thisyear=today.getFullYear()
for (var y=0; y<20; y++){
yearfield.options[y]=new Option(thisyear, thisyear)
thisyear+=1
}
yearfield.options[0]=new Option(today.getFullYear(),
today.getFullYear(), true, true) //select today's year
}
</script>
_____________________________________
I have this script in the Body of my asp page:
<script type="text/javascript">
//populatedropdown(id_of_day_select, id_of_month_select,
id_of_year_select)
window.onload=function(){
populatedropdown("daydropdown", "monthdropdown", "yeardropdown")
}
</script>
______________________________________
I have this code in a form on my asp page:
<select id="daydropdown">
</select>
<select id="monthdropdown">
</select>
<select id="yeardropdown">
</select>
________________________________________
PROBLEM: For some reason, instead of the daydropdown showing
24
25
26
27
28
it is displaying
24
25
26
26
28
Why is it not displaying the 27th day to select, i.e. tomorrow
Appreciate any help you can offer me
Thanks
David
for some reason, the day dropdown is displaying the 25th twice, instead
of 26th, then 27th ?
I have this script in the <head> of my asp page:
_____________________
<script type="text/javascript">
var
monthtext=['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sept','Oct','Nov','Dec'];
function populatedropdown(dayfield, monthfield, yearfield){
var today=new Date()
var dayfield=document.getElementById(dayfield)
var monthfield=document.getElementById(monthfield)
var yearfield=document.getElementById(yearfield)
for (var i=0; i<31; i++)
dayfield.options=new Option(i+1, i+1)
dayfield.options[today.getDate()]=new Option(today.getDate(),
today.getDate(), true, true) //select today's day
for (var m=0; m<12; m++)
monthfield.options[m]=new Option(monthtext[m], monthtext[m])
monthfield.options[today.getMonth()]=new
Option(monthtext[today.getMonth()], monthtext[today.getMonth()], true,
true) //select today's month
var thisyear=today.getFullYear()
for (var y=0; y<20; y++){
yearfield.options[y]=new Option(thisyear, thisyear)
thisyear+=1
}
yearfield.options[0]=new Option(today.getFullYear(),
today.getFullYear(), true, true) //select today's year
}
</script>
_____________________________________
I have this script in the Body of my asp page:
<script type="text/javascript">
//populatedropdown(id_of_day_select, id_of_month_select,
id_of_year_select)
window.onload=function(){
populatedropdown("daydropdown", "monthdropdown", "yeardropdown")
}
</script>
______________________________________
I have this code in a form on my asp page:
<select id="daydropdown">
</select>
<select id="monthdropdown">
</select>
<select id="yeardropdown">
</select>
________________________________________
PROBLEM: For some reason, instead of the daydropdown showing
24
25
26
27
28
it is displaying
24
25
26
26
28
Why is it not displaying the 27th day to select, i.e. tomorrow
Appreciate any help you can offer me
Thanks
David