|
Posted by Captain Paralytic on 02/20/07 15:41
On 20 Feb, 14:15, Toby A Inkster <usenet200...@tobyinkster.co.uk>
wrote:
> Captain Paralytic wrote:
> > 1) Use pure local javascript to populate the day select based on the
> > selected month. No submit required at all.
>
> Better still, initially provide a day select with 31 days, and then
> *depopulate* it based on the selected month. That way:
>
> - it's still very usable for non-JS users;
> - people can select the day first, then the month, if they wish.
>
> > 2) Use an AJAX type call to let php/javascript populate the day
> > select.
>
> As Kimmo said, AJAX is overkill here. Using AJAX, you add an extra
> round-trip to the server, break your form in non-AJAX-capable browsers,
> all for no real benefit. It's trivially easy to calculate the number of
> days in any given month using client-side Javascript. No advantage
> whatsoever in having the server do it for you.
I completely agree with this sentiment.
Remember that my preceeding statement was:
Anyway, it depends on what you mean by "a previous submit".
I would either use javascript to populate the list or a popup
calendar.
However, since the user had mentioned a submit, he may have had a
reason for going to the host, so I offered all the obvious options.
>
> (Of course, you will still need to do sanity checks on the server! One
> must always do so!)
>
> An alternative would be something like:
>
> <select>
> <option>01 Jan
> <option>02 Jan
> <option>03 Jan
> ...
> <option>30 Dec
> <option>31 Dec
> </select>
>
> though that adds about 5 kB of data to the page.
>
> --
> Toby A Inkster BSc (Hons) ARCS
> Contact Me ~http://tobyinkster.co.uk/contact
> Geek of ~ HTML/SQL/Perl/PHP/Python*/Apache/Linux
>
> * = I'm getting there!
Navigation:
[Reply to this message]
|