开发者

Can anyone suggest a resource that lists suggested maxlengths for common fields like city, email, phone, etc?

I know email addresses are limited to 254 characters, but is there a single resource that outlines suggested maxlengths for common fields like contact information e.g. phone, city, etc?

It seems every project I work people just shoot from the hip on their proposed li开发者_StackOverflow社区mits. I'm hoping to find a canonical reference, targeted to a specific country.

Edit - Updated email maxlength per comment.


I just found that the HR-XML Consortium posted their standards. Perhaps there is something in their download that addresses things like this.

http://www.hr-xml.org/hr-xml/wms/hr-xml-1-org/index.php?id={E00DA03B685A0DD18FB6A08AF0923DE0|139|2}

-- Original -- I've run into this problem before, after starting on any new project. And my answer here is just based off experience. I don't think there is a canonical reference. If you already have existing data, you could run a report and see what the max length is for any of the fields and add some padding. If you are going to be getting data from more than one country, then the max length may change based on the country.

Even if there was a canonical list based on country, it wouldn't be enough, because there exists > 1 language and culture in most countries, each possibly having their own "normal" lengths for each of the fields you are talking about.

Some common sense we apply: we usually cut off the address fields at 50. Why? well, I can't imagine anyone having an address that has 50 characters on it (how could you possibly fit that onto an envelope).

For things like phone numbers, we break it out and give the country and city codes their own fields, as well as for area codes. Then we cap the phone numbers at 15. Again, I've never seen a phone number (with all of the other stuff left out) > 15.

For the same reason, if you break up the name fields into first name/last name, you probably don't need 50 chars, 35 might suffice.


First of all, unless you are using a specific program that is limiting your emails their is no reason why it cannot be longer than 320 characters. What type of script are you using to push inputs to email?

Second, I've never seen a specific reference online but most developers I've worked with will limit textfields such as phone, email, name to 50 characters. Many times textareas will not have limits, but I always recommend 250-300 characters, sometime shorter depending on the type of response you're expecting.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜