From: David Mark on
Jukka K. Korpela wrote:
> bruce wrote:
>
> [ massive fullquote despite all the clues posted... ]
>
>> You are correct. The technical solution is simple. I have it working
>> with basically 4 lines of code.
>
> For some odd values of "working", I gather from the URL. (That is, its
> absence.)
>
> I bet your code does not even address one of the technical issues I
> mentioned: the number of days in February depends on the year, and your
> scenario (to the small amount it was revealed) postulates that the year
> is selected _after_ selecting month and day.
>
> But I do accept the idea that you can make almost everything work in 4
> lines of code in JavaScript. You might just need extraordinarily long
> lines at times.
>

Yes, but "chaining" hundreds of method calls together is "elegant"
according to many JS "programmers". Copy, paste, chain, etc. It just
works. Well, except in the many cases where it doesn't but they don't
"care" about those cases.
From: Stanimir Stamenkov on
Tue, 04 May 2010 08:53:37 -0400, /David Stone/:

> The bit I was commenting on was the TAGGED address portion, and
> NOT the domain name. Would you prefer I used a real, deliverable
> domain with the fred+usenet@ part, just to make a point? Didn't
> think so!

That's what I wanted stated clearer as I think an occasional reader
may not know about the reserved top-level domain names and the exact
valid production of the local part of an email address.

--
Stanimir
From: Dr J R Stockton on
In comp.infosystems.www.authoring.html message <oRaGpaE+mp3LFw6p(a)J.A830F
0FF37FB96852AD08924D9443D28E23ED5CD>, Mon, 3 May 2010 10:39:10, John G
Harris <john(a)nospam.demon.co.uk> posted:
>On Sun, 2 May 2010 at 22:08:03, in comp.lang.javascript, Garrett Smith
>wrote:
>
> <snip>
>>First name: [_______________]
>>Last name: [_______________]
>>Birth date {YYYY-MM-DD): [_______________]
> <snip>
>
>But accept
> 2010-05-03
> 2010-5-3
> 2010/5/3
> 2010.5.3
>as equally valid. (Unless you actively want to lose customers).

To be maximally helpful, allow [multiple] spaces as separators too. The
space bar is the biggest key on a normal keyboard.

For pattern validation,
/^\s*(\d+)\D+(\d+)\D+(\d+)\s*$/
/^\s*(\d+)(\D+)(\d+)(\2)(\d+)\s*$/
/^\s*(\d+)([/\.-])(\d+)(\2)(\d+)\s*$/
or similar should do, followed by setting the matches into
new Date(Y, M-1, D) and reading back the month (needs (\d\d?)
for the Day, IIRC)

If the application requires a moderately current date, the RegExp could
call for (20\d\d) or (201\d) for the year.

<URL:http://www.merlyn.demon.co.uk/js-date4.htm> refers.

"First name" / Last name" can be inappropriate in some cultures -
Chinese and Mongolian, for example, IIRC. Also, how about those who do
not use their first name - J. Edgar Hoover, George VI, for example? How
about middle initial(s)?

And those whose date of birth does not match their birthday?

How about those whose date of birth was 1900-02-29? Some may still be
alive.

--
(c) John Stockton, nr London, UK. ?@merlyn.demon.co.uk Turnpike v6.05.
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 estrdate.htm js-dates.htm pas-time.htm critdate.htm etc.
From: Dr J R Stockton on
In comp.lang.javascript message <da7d371e-e20d-408c-83a5-f8393c024c8e(a)a2
1g2000yqn.googlegroups.com>, Sun, 2 May 2010 19:45:58, bruce
<bruceaj(a)bellsouth.net> posted:
>I have 3 dropdown boxes, Month, Day, Year. When I change the month, I
>want the contents of the Day dropdown box be adjusted to the correct
>days in the new month. I would expect to be able to use an onChange
>event on the Month dropdown box. I don't know how to reset and reload
>the Day dropdown box.
>
>Can someone refer me to some sample code that does this?

Yes, near enough. However, since the length of the month depends on the
numbers of the month and year, and also forms should be filled in left
to right, top to bottom (if using a Western-type language), you need
HTML for Year, Month, Day. What you want should be disregarded.

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

--
(c) John Stockton, nr London, UK. ?@merlyn.demon.co.uk Turnpike v6.05.
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 estrdate.htm js-dates.htm pas-time.htm critdate.htm etc.
From: Gregor Kofler on
Am 2010-05-04 18:18, Dr J R Stockton meinte:

> How about those whose date of birth was 1900-02-29? Some may still be
> alive.

....but not longer hanging out on tennis courts... ;-)


--
http://www.gregorkofler.com