By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,866 Members | 1,660 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,866 IT Pros & Developers. It's quick & easy.

Looking for Javascript Date Picker

P: n/a
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 use for selecting the departure and arrival dates. I've had a look at
some sites, but mostly found calendars. I want to make mys tie accessible,
so I really want the three scroll boxes for the day, month and year.

Thanks for any help, much appreciated.

Hussein.
Jul 23 '05 #1
Share this Question
Share on Google+
13 Replies


P: n/a
Hussein Patwa wrote:
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 use for selecting the departure and arrival dates. I've had a look at
some sites, but mostly found calendars. I want to make mys tie accessible,
so I really want the three scroll boxes for the day, month and year.


Here's one:

http://freespace.virgin.net/phil.ronan/junk/date.html

--
Philip Ronan
ph***********@virgin.net
(Please remove the "z"s if replying by email)
Jul 23 '05 #2

P: n/a
JRS: In article <TI************@newsfe5-win.ntli.net>, dated Sat, 23
Oct 2004 11:59:47, seen in news:comp.lang.javascript, Hussein Patwa
<pa***@andrelouis.com> posted :
I'm new to this group.
So you should read the FAQ of the newsgroup, posted thrice weekly, bi-
partly.
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 use for selecting the departure and arrival dates.
Be aware that it's about twice as quick to type the date in, in a
stipulated numeric format such as DD/MM/YYYY or YYYY-MM-DD. If
required, the date can easily be verified as a valid Gregorian Calendar
date. Details via NG FAQ, or more directly via signature below.

I've had a look at
some sites, but mostly found calendars. I want to make mys tie accessible,
so I really want the three scroll boxes for the day, month and year.


Year, month, and day would be better. Only when the month is identified
can its length, and hence the range of the day field, be determined.

Think carefully before using a javascript picker; that should not be
allowed to be the cause of the site becoming inaccessible to those
without javascript operating.

See <URL:http://www.merlyn.demon.co.uk/js-date6.htm#DDD>.

For some purposes, the style of date picker shown below that might be
preferred.

--
John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 IE 4
<URL:http://www.jibbering.com/faq/> JL/RC: FAQ of news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htm> jscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.
Jul 23 '05 #3

P: n/a
Dr John Stockton wrote:
Be aware that it's about twice as quick to type the date in, in a
stipulated numeric format such as DD/MM/YYYY or YYYY-MM-DD. If
required, the date can easily be verified as a valid Gregorian Calendar
date. Details via NG FAQ, or more directly via signature below.
I think you'll find that most browsers allow you to change the contents of
drop-down menus by typing in the required value. So I would say drop-down
menus are preferable in any situation.
Year, month, and day would be better. Only when the month is identified
can its length, and hence the range of the day field, be determined.


You can control the presentation order of these fields, but you don't have
any control over the order in which they are filled in. Making dynamic
changes to the "Date" menu is a neat trick, but I'm not convinced it's
actually all that helpful.

--
Philip Ronan
ph***********@virgin.net
(Please remove the "z"s if replying by email)
Jul 23 '05 #4

P: n/a
Philip Ronan wrote:
Dr John Stockton wrote:

Be aware that it's about twice as quick to type the date in, in a
stipulated numeric format such as DD/MM/YYYY or YYYY-MM-DD. If
required, the date can easily be verified as a valid Gregorian Calendar
date. Details via NG FAQ, or more directly via signature below.

I think you'll find that most browsers allow you to change the contents of
drop-down menus by typing in the required value. So I would say drop-down
menus are preferable in any situation.


While its true that they allow you to change select lists, I can type my
birthdate in (the #1 date asked for), a lot faster than I can find it in
a select list. Not to mention the time it takes to scroll down to
December (or 12), then down to 22, and then down to 1966 or 66,
depending on how its set up.
--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq
Answer:It destroys the order of the conversation
Question: Why?
Answer: Top-Posting.
Question: Whats the most annoying thing on Usenet?
Jul 23 '05 #5

P: n/a
Randy Webb wrote:
Philip Ronan wrote:
I think you'll find that most browsers allow you to change the contents of
drop-down menus by typing in the required value. So I would say drop-down
menus are preferable in any situation.


While its true that they allow you to change select lists, I can type my
birthdate in (the #1 date asked for), a lot faster than I can find it in
a select list. Not to mention the time it takes to scroll down to
December (or 12), then down to 22, and then down to 1966 or 66,
depending on how its set up.


Huh? So type it in. If the value you're entering exists in the menu, it will
appear as soon as you type in enough characters to identify it. So for
example to select "December" in the month menu, just select it and press
"D". You don't need to scroll anything. Read my last post again.

--
Philip Ronan
ph***********@virgin.net
(Please remove the "z"s if replying by email)
Jul 23 '05 #6

P: n/a
Philip Ronan wrote:
Randy Webb wrote:

Philip Ronan wrote:

I think you'll find that most browsers allow you to change the contents of
drop-down menus by typing in the required value. So I would say drop-down
menus are preferable in any situation.


While its true that they allow you to change select lists, I can type my
birthdate in (the #1 date asked for), a lot faster than I can find it in
a select list. Not to mention the time it takes to scroll down to
December (or 12), then down to 22, and then down to 1966 or 66,
depending on how its set up.

Huh? So type it in. If the value you're entering exists in the menu, it will
appear as soon as you type in enough characters to identify it. So for
example to select "December" in the month menu, just select it and press
"D". You don't need to scroll anything. Read my last post again.


And how does that make it "Better" or "Quicker" when attempting to find
22 or 1966 in a menu? So no, its not "preferable in any situation". I
prefer the input type="text" style.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq
Answer:It destroys the order of the conversation
Question: Why?
Answer: Top-Posting.
Question: Whats the most annoying thing on Usenet?
Jul 23 '05 #7

P: n/a
Philip Ronan wrote:
to select "December" in the month menu, just select it and press "D"


Sorry, that wasn't clear.

Move the focus to the "Month" drop-down menu, then press "D".

Basically the keystrokes are the same as for text input boxes, but with an
autocomplete function so you don't necessarily have to type in the whole
date.

--
Philip Ronan
ph***********@virgin.net
(Please remove the "z"s if replying by email)
Jul 23 '05 #8

P: n/a
Philip Ronan wrote:
Philip Ronan wrote:

to select "December" in the month menu, just select it and press "D"

Sorry, that wasn't clear.

Move the focus to the "Month" drop-down menu, then press "D".


Not sure why you think that wasn't clear, but to each his own.
Basically the keystrokes are the same as for text input boxes, but with an
autocomplete function so you don't necessarily have to type in the whole
date.


When I type, out of habit, December on a select list as follows:

<select>
<option>January</option>
<option>Feb</option>
<option>Mar</option>
<option>Apr</option>
<option>May</option>
<option>June</option>
<option>July</option>
<option>August</option>
<option>September</option>
<option>October</option>
<option>November</option>
<option>December</option>
</select>

March is what is selected, not December, so no, the keystrokes are not
the same.

May nor Mar give me May or March, it gives me April.

Shall I continue with key combinations that do not give the intended
results or do you propose that I should hit the tab key to gain focus,
type Ma and look to see what it gives me? Or, can I do as I normally do
and just continuously type?

Whether you like Selects or Text Inputs is a matter of personal choice.
You prefer Selects, I prefer Text Inputs. Neither of us is right,
neither of us is wrong. We can argue about it until dooms-day and its a
no-win argument.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq
Jul 23 '05 #9

P: n/a
Randy Webb wrote:
When I type, out of habit, December on a select list as follows:

<select>
<option>January</option>
<option>Feb</option>
<option>Mar</option>
<option>Apr</option>
<option>May</option>
<option>June</option>
<option>July</option>
<option>August</option>
<option>September</option>
<option>October</option>
<option>November</option>
<option>December</option>
</select>

March is what is selected, not December, so no, the keystrokes are not
the same.


I wonder what the keystrokes for "December" might be then?

Perhaps there's something wrong with your browser.

--
Philip Ronan
ph***********@virgin.net
(Please remove the "z"s if replying by email)
Jul 23 '05 #10

P: n/a
q
Keep pressing 'm' and cycle through each item beginning with the letter 'm'

Randy Webb wrote:
Philip Ronan wrote:
Philip Ronan wrote:

to select "December" in the month menu, just select it and press "D"


Sorry, that wasn't clear.

Move the focus to the "Month" drop-down menu, then press "D".

Not sure why you think that wasn't clear, but to each his own.
Basically the keystrokes are the same as for text input boxes, but
with an
autocomplete function so you don't necessarily have to type in the whole
date.

When I type, out of habit, December on a select list as follows:

<select>
<option>January</option>
<option>Feb</option>
<option>Mar</option>
<option>Apr</option>
<option>May</option>
<option>June</option>
<option>July</option>
<option>August</option>
<option>September</option>
<option>October</option>
<option>November</option>
<option>December</option>
</select>

March is what is selected, not December, so no, the keystrokes are not
the same.

May nor Mar give me May or March, it gives me April.

Shall I continue with key combinations that do not give the intended
results or do you propose that I should hit the tab key to gain focus,
type Ma and look to see what it gives me? Or, can I do as I normally do
and just continuously type?

Whether you like Selects or Text Inputs is a matter of personal choice.
You prefer Selects, I prefer Text Inputs. Neither of us is right,
neither of us is wrong. We can argue about it until dooms-day and its a
no-win argument.


Jul 23 '05 #11

P: n/a
Philip Ronan wrote:
Randy Webb wrote:

When I type, out of habit, December on a select list as follows:

<select>
<option>January</option>
<option>Feb</option>
<option>Mar</option>
<option>Apr</option>
<option>May</option>
<option>June</option>
<option>July</option>
<option>August</option>
<option>September</option>
<option>October</option>
<option>November</option>
<option>December</option>
</select>

March is what is selected, not December, so no, the keystrokes are not
the same.

I wonder what the keystrokes for "December" might be then?

Perhaps there's something wrong with your browser.


Its IE6 SP2 running on Windows XP SP2.

When tested in Opera, and I type D E C E M B E R, January remains chosen
unless I open the drop down and then type.

Mozilla is the only one of the three that does what you say it should do
and it does indeed leave December chosen when I type D E C E M B E R.
And Mozilla is my preferred browser, but it is far from the predominant
browser on the 'net, and when testing scripts, I typically test it in IE
first simply because that is the predominance of browsers then I go to
Mozilla. Personal preference is all.

IE6 is also the only one that adds a scrollbar to that select list.

In Opera 7, typing M A R C H leaves May selected.
In Mozilla, it gives the right one, leaving March selected.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq
Jul 23 '05 #12

P: n/a
q@q.com wrote:
Keep pressing 'm' and cycle through each item beginning with the letter 'm'


So when I want to have May show up, I am supposed to type M M and that
is intuitive to the unknowing?

But I also know, and have stated before, that select lists are a lot
more reliable for user input when the possible knowns are a limited set.
Makes it easier to know its March when you see March than when you Maych
because of a typo.

Consult the FAQ, via signature, especially Section 2.3 paragraph 6.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq
Answer:It destroys the order of the conversation
Question: Why?
Answer: Top-Posting.
Question: Whats the most annoying thing on Usenet?
Jul 23 '05 #13

P: n/a
JRS: In article <BD**************************@virgin.net>, dated Sun, 24
Oct 2004 12:39:35, seen in news:comp.lang.javascript, Philip Ronan
<ph***********@virgin.net> posted :
Dr John Stockton wrote:
Be aware that it's about twice as quick to type the date in, in a
stipulated numeric format such as DD/MM/YYYY or YYYY-MM-DD. If
required, the date can easily be verified as a valid Gregorian Calendar
date. Details via NG FAQ, or more directly via signature below.


I think you'll find that most browsers allow you to change the contents of
drop-down menus by typing in the required value. So I would say drop-down
menus are preferable in any situation.


Entering "Mar" in a TLA month box gives me "Apr". "May" -> "Aug". "Aug"
-> "Apr".

Non-expert users will find entering into three boxes slower than entering
space-separated items into a text box (one can define the allowable
separators as \D+ \D+ or as \D+ \1).

Year, month, and day would be better. Only when the month is identified
can its length, and hence the range of the day field, be determined.


You can control the presentation order of these fields, but you don't have
any control over the order in which they are filled in. Making dynamic
changes to the "Date" menu is a neat trick, but I'm not convinced it's
actually all that helpful.


Most users will enter data from left to right. One has influence, if not
control.

It occurs to me that it might be useful to add day-of-week TLA to the
date box entries; this would mean reloading the whole date drop-down on
(almost) any change of month and year. Sometimes, one may know the
desired day-of-week better than the desired date.

--
John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 MIME.
Web <URL:http://www.merlyn.demon.co.uk/> - w. FAQish topics, links, acronyms
PAS EXE etc : <URL:http://www.merlyn.demon.co.uk/programs/> - see 00index.htm
Dates - miscdate.htm moredate.htm js-dates.htm pas-time.htm critdate.htm etc.
Jul 23 '05 #14

This discussion thread is closed

Replies have been disabled for this discussion.