Results 1 to 2 of 2

Thread: Date binding from 3 text fields

  1. #1

    Default Date binding from 3 text fields

    I wonder if there is a nice way to enter java.util.Date field from 3 HTML fields: [dd] - [mm] - [yyyy]. I looked through ServletRequestDataBinder but it looks like there is no way to compose a single property from several input fields. I can only see solution that creates DateBean custom bean extending java.util.Date with date, month, year properties. Anyone has any sugessions ?

    Thanks.
    Sergei Rogovskiy

  2. #2
    Join Date
    Aug 2004
    Location
    Melbourne, Australia
    Posts
    1,104

    Default

    I can only see solution that creates DateBean custom bean extending java.util.Date with date, month, year properties.
    That would work. Not sure how else it could be done as Spring maps from form input fields to properties.

    Anyone has any sugessions ?
    Use Javascript to combine them into one field (yuk).

    Keeping the fields separate means you can validate them separately if you want to. E.g. Day of 30 is invalid if month is Feb.

Similar Threads

  1. Replies: 1
    Last Post: Sep 22nd, 2005, 04:42 AM
  2. Replies: 1
    Last Post: Aug 19th, 2005, 08:24 AM
  3. Replies: 15
    Last Post: Aug 6th, 2005, 07:22 AM
  4. Replies: 3
    Last Post: Jul 7th, 2005, 06:51 PM
  5. Replies: 2
    Last Post: Aug 17th, 2004, 04:16 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •