# Date\_select validate all fields selected

**URL:** <https://www.ruby-forum.com/t/date-select-validate-all-fields-selected/168873>\
**Category:** Rails\
**Created:** [May 26, 2009, 11:15pm UTC](https://www.ruby-forum.com/t/date-select-validate-all-fields-selected/168873 "2009-05-26T23:15:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![S\_thief\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/91b2a8/32.png) [@S\_thief\_S](https://www.ruby-forum.com/u/S_thief_S)\
**Post date:** [May 26, 2009, 11:15pm UTC](https://www.ruby-forum.com/t/date-select-validate-all-fields-selected/168873/1 "2009-05-26T23:15:26Z")

</div>

Hi,

date\_select seems to behave rather strangely if :prompt =\> true  
or :empty =\> true and the user does not select all fields.

It seems that by the time the birth\_date field gets to validation, its  
filled with a Date object that has defaults set for empty fields. eg  
If a year is selected but month and day are not, then month and day  
are set to january 1st. This is really not intuitive but I’m still new  
to rails (made the move from CakePHP at last!) - maybe I’m doing  
something wrong.

Is there a best practice here that I don’t know about?

Thanks!
