What html5 form attribute should be used for a zipcode?

前端 未结 8 2155
我寻月下人不归
我寻月下人不归 2021-02-01 02:51

Is it best to use a \'text\' attribute with a limit on the number of characters, or can I use a number attribute in an input for a zipcode.

Just trying to get my head ar

8条回答
  •  暗喜
    暗喜 (楼主)
    2021-02-01 03:26

    If you have any international users you are going to want to allow alpha numeric via type="text"

    Example: UK postal codes are formatted as AA9A 9AA

    9 = any number

    A = any letter

提交回复
热议问题