# Clear form field

**URL:** <https://www.ruby-forum.com/t/clear-form-field/170844>\
**Category:** Rails\
**Created:** [June 23, 2009, 2:38pm UTC](https://www.ruby-forum.com/t/clear-form-field/170844 "2009-06-23T14:38:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pkatare](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ac8455/32.png) [@pkatare](https://www.ruby-forum.com/u/pkatare)\
**Post date:** [June 23, 2009, 2:38pm UTC](https://www.ruby-forum.com/t/clear-form-field/170844/1 "2009-06-23T14:38:02Z")

</div>

Hi all,  
I want to clear password field and confirm password field after  
both are not match.currently both field cotain data after both are not  
match.  
Is there any way of doing this?.

Thanks  
Prashant

---

<div class="post-metadata">

**Author:** ![pkatare](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ac8455/32.png) [@pkatare](https://www.ruby-forum.com/u/pkatare)\
**Post date:** [June 25, 2009, 8:30am UTC](https://www.ruby-forum.com/t/clear-form-field/170844/2 "2009-06-25T08:30:35Z")

</div>

Prashant K. wrote:

> Hi all,  
> I want to clear password field and confirm password field after  
> both are not match.currently both field cotain data after both are not  
> match.  
> Is there any way of doing this?.
> 
> Thanks  
> Prashant

Hi all,  
I got the answer:

```
  I used :value=>"" in password field and confirm password field 

```

option.

Thanks  
Prashant K.
