# How can I make date\_select return to default value?

**URL:** <https://www.ruby-forum.com/t/how-can-i-make-date-select-return-to-default-value/90036>\
**Category:** Rails\
**Created:** [March 25, 2007, 11:37am UTC](https://www.ruby-forum.com/t/how-can-i-make-date-select-return-to-default-value/90036 "2007-03-25T11:37:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jko170](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/d07c76/32.png) [@jko170](https://www.ruby-forum.com/u/jko170)\
**Post date:** [March 25, 2007, 11:37am UTC](https://www.ruby-forum.com/t/how-can-i-make-date-select-return-to-default-value/90036/1 "2007-03-25T11:37:53Z")

</div>

I have an \_edit and \_new partial that has the same text fields. When I  
edit an object via ajax by rendering the edit partial, the date\_select  
becomes the objects date. After the object is saved (updated) the \_new  
partial replaces the edit partial and the date\_select date is Still of  
the previous object. I would like the date\_select to return to todays  
date when the \_new partial is rendered. It does it of course when I  
refresh the page, but not with ajax. Any pointers?

---

<div class="post-metadata">

**Author:** ![jko170](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/d07c76/32.png) [@jko170](https://www.ruby-forum.com/u/jko170)\
**Post date:** [March 25, 2007, 9:19pm UTC](https://www.ruby-forum.com/t/how-can-i-make-date-select-return-to-default-value/90036/2 "2007-03-25T21:19:06Z")

</div>

This is what I’m using to clear one of the text fields:  
page \<\< “$(‘payment\_amount’).value = ‘’”

How can I “clear” the date select to return to today’s date?
