how many characters are possible in an input field in html?

前端 未结 6 1856
小蘑菇
小蘑菇 2020-12-01 14:35

What is the \"natural\" number of allowed characters in an input field in html?

thanks a lot

addition due to the comments

i don\'t n

6条回答
  •  失恋的感觉
    2020-12-01 15:08

    I think that depends on the method you are sending the form with. If you send the form via GET-method it's only 255 chars for the whole query (correct me if I am wrong). The POST-method allows much more...

    So in the end you can write millions of chars in a text-field, the question is, if all chars are sent to the server.

    In HTML however you've got the possibility to specify how many characters you want to allow. Look at this snippet:

    
    

    The maxlength-attribute of the tag, prevents the user from being able to type in more than 255 chars.

提交回复
热议问题