On Thu, 21 Jun 2007 12:38:38 -0400, Randy Webb
<Hi************@aol.comwrote:
>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.!
Hmmm. Let me get out my crystal ball and determine what browser you are
using on each machine, along with the code you are using, then I can try
to come up with some idea of why it isn't working. Aside from that, my
"light" tells me that something in your page or your script isn't
getting along real well with your browser.
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','S ept','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>