cformsII Support Forum
Current User: Guest *Frequently Asked Questions*
Search 
Search Forums:


 




Phone number: multiple inputs horizontally?

Add a New Topic Reply to Post
Post

appleo - Guest

3:28 pm - June 21, 2008

Please replace the ??? with your data!


[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!
_


Oliver - Admin

6:09 pm - June 21, 2008

posts 3549

Why have three input fields and not just one with the above expected input structure? (The field wouldn't validate if not entered as expected)

appleo - Guest

10:06 pm - June 21, 2008

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.


Oliver - Admin

8:12 am - June 22, 2008

posts 3549

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]


appleo - Guest

8:01 pm - June 22, 2008

Thanks. I may opt for that. Its a reasonable "compromise".

Add a New Topic Reply to Post


Reply to Topic: Phone number: multiple inputs horizontally?
PLEASE READ THE FAQs FIRST! THANK YOU.

NOTE: New Posts are subject to administrator approval before being displayed

Guest Name (Required):

Guest EMail (Required):

Guest URL (required)

Math Required!
What is the sum of: 3 + 5        (Required)

Topic Reply:


 
© Simple:Press Forum - Version 3.1.3 (Build 356)