cforms II User Forum

Registration is currently disabled.
Guest

FAQs

Login form protected by Login LockDown.


Lost password?
Advanced Search

— Forum Scope —

  

— Match —

   

— Forum Options —

    

Wildcard usage:
*  matches any number of characters    %  matches exactly one character

Minimum search word length is 4 characters - maximum search word length is 84 characters

Topic RSS
Phone number: multiple inputs horizontally?
June 21, 2008
3:28 pm
appleo
Guest

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

June 21, 2008
6:09 pm
Oliver
Munich, Germany
Admin
Forum Posts: 6400
Member Since:
March 6, 2005
Offline

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)

June 21, 2008
10:06 pm
appleo
Guest

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.

June 22, 2008
8:12 am
Oliver
Munich, Germany
Admin
Forum Posts: 6400
Member Since:
March 6, 2005
Offline

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]

June 22, 2008
8:01 pm
appleo
Guest

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

Forum Timezone: Europe/Berlin

Most Users Ever Online: 959

Currently Online:
24 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

tracedef: 43

mores: 21

Gyrus: 20

frozenwaste: 18

asuffredini: 15

photoworks: 14

Member Stats:

Guest Posters: 3762

Members: 1463

Moderators: 3

Admins: 2

Forum Stats:

Groups: 1

Forums: 4

Topics: 5359

Posts: 18741

Newest Members: juredujmovic, dreamkeeper, rajattyagi, wrokaa, lukass

Moderators: Paul (421), cnymike (8), sonika (95)

Administrators: Oliver (6400), Nicky (3)