tsgrp / ActiveWizard

OpenContent Dynamic Forms and Workflow
http://www.tsgrp.com/products/opencontentforms/
4 stars 0 forks source link

Support Arbitrary Answer Masks #109

Open gsteimer opened 9 years ago

gsteimer commented 9 years ago

We should support all of the answer masks that can be configured in the AW Admin

The following fields should auto-format their values:

mikeblum commented 9 years ago

To support controls like number we'll need to add finer controls such as a minimum number, maximum, increment, etc. Right now all we can specify is Number without any bounds.

gsteimer commented 9 years ago

@mikeblum - At some point, we're going to have to support any regex, since the wizard admin lets you do that. So whether or not we use the HTML5 controls (which are ideal), we'll still going to need a generic "matches this pattern" validator at some point... If we build that control, it should be trivial for it to validate a regex like: /^\d+$/

mikeblum commented 9 years ago

Based on how we wrote the validation service i'd imagine that shouldn't be too hard as it would either be a rule or a new kind of mask logic on the page set itself.

In regard to phone numbers, we might want to deploy google's number validator from HN: https://code.google.com/p/libphonenumber/

Right now all we do is a digit check which isn't so great for validation.

mikeblum commented 9 years ago

Keeping this open to track new feature support for masks - such as better phone number validation and how to handle arbitrary regex.

Revision: 11412 Author: mblum Date: 2014-12-30 10:23:20.893969 answer input mask support for SSNs, zip codes, military time, and phone # or N/A: https://github.com/tsgrp/ActiveWizard/issues/109.

M /trunk/code/app/modules/wizard/views/controltypes.js M /trunk/code/test/tests/modules/wizard/services/formatserviceSpec.js M /trunk/code/test/tests/modules/wizard/services/validationserviceSpec.js M /trunk/code/app/modules/wizard/services/pagesetinstanceprovider.js M /trunk/code/app/modules/wizard/services/formatservice.js M /trunk/code/app/modules/wizard/services/validationservice.js

mikeblum commented 9 years ago

since we don't support arbitrary regex in the aw admin, all masks outside of what we support above will be upon client request.