Questions tagged [maxlength]

Maxlength specifies the maximum number of characters allowed in an element (like a string, a database field, an html input box, etc.).

Maxlength specifies the maximum number of characters allowed in an element (like a string, a database field, an html input box, etc.).

550 questions
838
votes
22 answers

What's the best way to limit text length of EditText in Android

What's the best way to limit the text length of an EditText in Android? Is there a way to do this via xml?
hpique
  • 119,096
  • 131
  • 338
  • 476
353
votes
8 answers

What is the MySQL VARCHAR max size?

I would like to know what the max size is for a MySQL VARCHAR type. I read that the max size is limited by the row size which is about 65k. I tried setting the field to varchar(20000) but it says that that's too large. I could set it to…
user1832628
  • 3,859
  • 3
  • 16
  • 10
194
votes
11 answers

How to programmatically set maxLength in Android TextView?

I would like to programmatically set maxLength property of TextView as I don't want to hard code it in the layout. I can't see any set method related to maxLength. Can anyone guide me how to achieve this?
UMAR-MOBITSOLUTIONS
  • 77,236
  • 95
  • 209
  • 278
133
votes
11 answers

Retrieve the maximum length of a VARCHAR column in SQL Server

I want to find the longest VARCHAR in a specific column of a SQL Server table. Here's an example: ID = INT IDENTITY DESC = VARCHAR(5000) ID | Desc ---|----- 1 | a 2 | aaa 3 | aa What's the SQL to return 3? Since the longest value is 3…
Milo LaMar
  • 2,146
  • 2
  • 14
  • 25
88
votes
20 answers

Specifying maxlength for multiline textbox

I'm trying to use asp: I want a way to specify the maxlength property, but apparently there's no way possible for a multiline textbox. I've been trying to use some…
Blerta
  • 2,170
  • 5
  • 23
  • 34
85
votes
9 answers

Limit on file name length in bash

The following questions are meant for bash and linux only: Is there a limit on the number of characters in the absolute path name of a file? Is there a limit on the number of characters for the filename (without extension) only? If so, what…
Sriram
  • 10,298
  • 21
  • 83
  • 136
46
votes
10 answers

Chrome counts characters wrong in textarea with maxlength attribute

Here is an example: $(function() { $('#test').change(function() { $('#length').html($('#test').val().length) }) })