Javascript date routine ...Anyone shed some light on it please??



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.!



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
Regards Andy T



--
For users by users - BY-users group
<http://www.by-users.co.uk>
.



Relevant Pages

  • Getting html or some other script in some popups
    ... I get html script. ... var nState = qw.Command.REG_GetState; ... // It's worth noting that hiding the snapshot by trying to ... Quicken registration requires cookies and an internet ...
    (microsoft.public.windowsxp.general)
  • Re: Cant see scripts on page.
    ... Go to Internet Options> Security> Internet Zone, ... > I have a website where I have installed an asp script to show a banner ad ... > var SymRealWinOpen = window.open; ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: Javascript date routine (in droip down boxes_
    ... I am using a small java script that puts up the date in three drop ... It is not internet ... But its the same browser on the other machines that do. ... var today=new Date ...
    (comp.lang.javascript)
  • RE: IE Script Error
    ... How to Troubleshoot Script Errors in Internet Explorer ... The following warning message may also appear in the Microsoft Internet ... To update the scripting engine for Internet Explorer on Microsoft Windows ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • RE: Script Error
    ... How to Troubleshoot Script Errors in Internet Explorer ... The following warning message may also appear in the Microsoft Internet ... To update the scripting engine for Internet Explorer on Microsoft Windows ...
    (microsoft.public.windows.inetexplorer.ie6.browser)