NUBIC/surveyor — pull request #415 by jdzak (2013-02-28 02:30:32+00:00)
Title: Add input mask for text entry fields

Having a way to specify an input mask for text boxes would provide users a visual cue when entering certain types of data (e.g. phone numbers or zip code), and it would constrain what is entered to either alpha/numeric/both as well as the length of input.

One possible way to implement this would be to add a property on answer..

q 'If you have a phone the user would see..
a :string, :input_mask => '(999)999-9999'

# Produces
# (___) ___ - ____

As an extra, it would be nice to control the placeholder character. So for example, instead of having an underscore as the placeholder, you could use 'Y' if you need the user to enter a year.