Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Check date input

LEGEND ,
Oct 12, 2006 Oct 12, 2006
A user can enter a date into a form field. The date will be inserted
into a database. The input has to be as yyyy-mm-dd.

How can I control the input and display an error message if the user
enters dd.mm.yyyy?

Martin
TOPICS
Server side applications
354
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 12, 2006 Oct 12, 2006
i'd use separate fields for year, month, day. then just concatenate them
before inserting in the DB

using list/menu fields you also simplify the validation

Martin Lang wrote:
> A user can enter a date into a form field. The date will be inserted
> into a database. The input has to be as yyyy-mm-dd.
>
> How can I control the input and display an error message if the user
> enters dd.mm.yyyy?
>
> Martin
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 12, 2006 Oct 12, 2006
John Doe schrieb:
> i'd use separate fields for year, month, day. then just concatenate them
> before inserting in the DB

Good idea - thank you!

Martin
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 13, 2006 Oct 13, 2006
Or use a javascript Datepicker - there are plenty of decent free ones on the
web and most have Date formatting options.


"Martin Lang" <mart@nospam.net> wrote in message
news:egm6sn$e3i$1@forums.macromedia.com...
> John Doe schrieb:
>> i'd use separate fields for year, month, day. then just concatenate them
>> before inserting in the DB
>
> Good idea - thank you!
>
> Martin


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 13, 2006 Oct 13, 2006
LATEST
> Or use a javascript Datepicker - there are plenty of decent free ones on the
> web and most have Date formatting options.

I thought about and downloaded a datepicker from blueshoes.
Thank you!
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines