# Edit masks for form fields

**URL:** <https://www.ruby-forum.com/t/edit-masks-for-form-fields/165040>\
**Category:** Rails\
**Created:** [April 8, 2009, 3:17pm UTC](https://www.ruby-forum.com/t/edit-masks-for-form-fields/165040 "2009-04-08T15:17:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bruparel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/e47774/32.png) [@bruparel](https://www.ruby-forum.com/u/bruparel)\
**Post date:** [April 8, 2009, 3:17pm UTC](https://www.ruby-forum.com/t/edit-masks-for-form-fields/165040/1 "2009-04-08T15:17:29Z")

</div>

I have several fields in forms that have either dollar values, e.g.,  
book value, and integer values, e.g., age of the building.

I would like to put some edit masks on them. What is the easiest way of  
doing that in Rails?

Bharat

---

<div class="post-metadata">

**Author:** ![bruparel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/e47774/32.png) [@bruparel](https://www.ruby-forum.com/u/bruparel)\
**Post date:** [June 19, 2009, 1:07pm UTC](https://www.ruby-forum.com/t/edit-masks-for-form-fields/165040/2 "2009-06-19T13:07:28Z")

</div>

I am also struggling to figure this out.

I need people to be able to enter $1000 in an integer field. By the  
time the data arrives in before\_validation any value with characters  
(i.e. $) has been reset to zero.

did you find an answer to this?

James

Bharat R. wrote:

> I have several fields in forms that have either dollar values, e.g.,  
> book value, and integer values, e.g., age of the building.
> 
> I would like to put some edit masks on them. What is the easiest way of  
> doing that in Rails?
> 
> Bharat
