Javascript date routine ...Anyone shed some light on it please??
- From: Andy T <andy@xxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 26 Jun 2007 22:57:27 GMT
On Fri, 22 Jun 2007 07:24:01 GMT, Andy T
<andy@xxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
On Thu, 21 Jun 2007 12:38:38 -0400, Randy Webb
<HikksNotAtHome@xxxxxxx> wrote:
Andy T said the following on 6/21/2007 12:27 PM:
Hi
I am using a small java script that puts up the date in three drop
down menus.
The scripts works beautifully on most machines BUT will not work on my
lap top. The drop down boxes are produced BUT no chnaracters go in
the boxes.
Any one shed any light on why this should happen. It is not internet
related as it works fine on my other machine that is not conncted to
the internet at all.!
Regards Andy T
internet explorer 6 is the one which does not display the characters.
But its the same browser on the other machines that do. I have since
found out that BOTH my laptops will not display the characters and one
of those is connected to the internet. It gets more and more
intriguing by the day!
the script is this
<script type="text/javascript">
/***********************************************
* Drop Down Date select script- by JavaScriptKit.com
* This notice MUST stay intact for use
* Visit JavaScript Kit at http://www.javascriptkit.com/ for this
script and more
***********************************************/
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[i]=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>
</head>
<body>
<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>
Regards Andy T
--
For users by users - BY-users group
<http://www.by-users.co.uk>
.
- References:
- Javascript date routine (in droip down boxes_
- From: Andy T
- Re: Javascript date routine (in droip down boxes_
- From: Randy Webb
- Re: Javascript date routine (in droip down boxes_
- From: Andy T
- Javascript date routine (in droip down boxes_
- Prev by Date: Re: Limit selection in list Box
- Next by Date: FAQ Topic - Why do I get permission denied when accessing a frame/window?
- Previous by thread: Re: Javascript date routine (in droip down boxes_
- Next by thread: detecting windows vista
- Index(es):
Relevant Pages
|
|