[desc]:I am working with a client who specifically wants a phone number (US) to be expressed as: [123]-[123]-[1234]. Presumably this has to be done with one label, and three inputs, stacked horizontally. Easy enough if manually creating a form, but is there any way to do this with cforms? Any other ideas for enforcing proper phone number input?
Overall I find cforms immensely productive. Thanks for the great tool! _
OK, that sounds good too. But I can't see how to do one input and maintain the integrity of that particular structure short of a lot of js razzle dazzle. IOW, the field starts as
[ - - ]
and can only have numbers inserted where blanks are, the dashes are permanent fixtures that can't be overwritten. Is that what your suggestion is? Or do we give them a blank field, tell them numbers with dashes in the right place and enforce that after submittal with regexes? But I like my way better ;-) Thx.
the dashes are permanent fixtures that can't be overwritten.
the regexp would ensure that dashed are in place.
I would do it this way:
phone number|[xxx]-[xxx]-[xxxx]|^\[[0-9]{3}\]-\[[0-9]{3}\]-\[[0-9]{4}\]$|title:Please note the required input format!|err:Please enter your phone number in the required way: [xxx]-[xxx]-[xxxx]