473,385 Members | 2,274 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Javascript date routine (in droip down boxes_

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

Thanks in advance
Regards Andy T

--
For users by users - BY-users group
<http://www.by-users.co.uk>
Jun 21 '07 #1
3 1423
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.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Jun 21 '07 #2
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>
Jun 22 '07 #3
On Fri, 22 Jun 2007 07:24:01 GMT, in comp.lang.javascript Andy T
<an**@westmidland-internet.co.uk>
<1t********************************@4ax.comwrote :
>| 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">
|
[snip code]

I added:
<select name="daydropdown" size="1" id="daydropdown">
</select>
<select name="monthdropdown" size="1" id="monthdropdown">
</select>
<select name="yeardropdown" size="1" id="yeardropdown">
</select>

Works perfectly in iE7 and FF2. Are you referencing the correct id's?
---------------------------------------------------------------
jn******@yourpantsyahoo.com.au : Remove your pants to reply
---------------------------------------------------------------
Jun 23 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Xerxes | last post by:
Hi, how can I pass the returned value from Javascript to PHP? I have: ------------------------------------------------------------------------ ------ if ( x>y) {
13
by: Hussein Patwa | last post by:
Hi there. I'm new to this group. I'm also partially sighted so navigating the web is sometimes quite difficult. I'm looking for a javascript date picker, you know the ones that travel sites...
9
by: Astra | last post by:
Hi everybody Wonder if you could help me out. I created a simple JavaScript routine to enable a user to click backwards and forwards between small news articles. This routine works fine in IE...
9
by: beguigne | last post by:
Below is a snippet of a crude date picking routine for a form. I am a novice at this so, I am hitting my head at why when I select the day, the onChange event gives me a blank. What am I missing?...
136
by: Matt Kruse | last post by:
http://www.JavascriptToolbox.com/bestpractices/ I started writing this up as a guide for some people who were looking for general tips on how to do things the 'right way' with Javascript. Their...
10
by: melissa.nava | last post by:
Here is my code: ***** Public Property DOB() As Date Get Try DOB = (msBirthMonth + "/" + msBirthDay + "/" + msBirthYear)
2
by: sorobor | last post by:
dear sir .. i am using cakephp freamwork ..By the way i m begener in php and javascript .. My probs r bellow I made a javascript calender ..there is a close button ..when i press close button...
18
by: www.gerardvignes.com | last post by:
Upcoming Changes to the JavaScript Language (presented by Google) http://youtube.com/watch?v=-yDS1eGfuWQ I really enjoyed this presentation. If they can get the same improvement in...
3
by: Hanoodah | last post by:
Good morning all, Please I need help in a form that I have designed to fill user information. This form needs two drop-down list about specific date, one about contract date, and the other about...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.