# Overriding or changing HTML generated by date\_select?

**URL:** <https://www.ruby-forum.com/t/overriding-or-changing-html-generated-by-date-select/124211>\
**Category:** Rails\
**Created:** [December 26, 2007, 3:42pm UTC](https://www.ruby-forum.com/t/overriding-or-changing-html-generated-by-date-select/124211 "2007-12-26T15:42:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [December 26, 2007, 3:42pm UTC](https://www.ruby-forum.com/t/overriding-or-changing-html-generated-by-date-select/124211/1 "2007-12-26T15:42:17Z")

</div>

Hi,

I’m looking for a way to customize the HTML forms generated by  
date\_select. I’m especially keen on replacing the year and possibly  
day input by a simple text field, since honestly, I find listboxes for  
years to be quite retarded (if I wanted client-side validation, there  
would be better ways to do that instead of having people try and find  
their year of birth in a list of approximately a hundred entries). Is  
there a way to do that without manually hardcoding form fields in the  
view?

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [December 26, 2007, 7:26pm UTC](https://www.ruby-forum.com/t/overriding-or-changing-html-generated-by-date-select/124211/2 "2007-12-26T19:26:36Z")

</div>

On Dec 26, 2007 3:41 PM, removed\_email\_address@domain.invalid [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> I’m looking for a way to customize the HTML forms generated by  
> date\_select.

You can hack ActiveView::Helpers::DateHelper if you’d like, or wrap  
date\_select in a helper of your own and manipulate the output there,  
but I suspect you’ll do just as well without it.

Take a look at this railscast:

> **[\#32 Time in Text Field - RailsCasts](http://railscasts.com/episodes/32-time-in-text-field)**
>
> Short Ruby on Rails screencasts containing tips, tricks and tutorials. Great for both novice and experienced web developers.

I think Ryan B. shows how to do almost exactly what you want.

- Martin

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [December 27, 2007, 7:29pm UTC](https://www.ruby-forum.com/t/overriding-or-changing-html-generated-by-date-select/124211/3 "2007-12-27T19:29:38Z")

</div>

On Dec 26, 7:26 pm, “Martin S.” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> On Dec 26, 2007 3:41 PM, removed\_email\_address@domain.invalid [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > I’m looking for a way to customize the HTML forms generated by  
> > date\_select.  
> > …
> 
> Take a look at this railscast:[#32 Time in Text Field - RailsCasts](http://railscasts.com/episodes/32)

Thanks a lot, that looks like a good point to start from. They need to  
make those casts more search-friendly in some way, all that web  
searches turned up were JScript calendars.
