Mind blowing SEO improving and Google rank increasing Signature Rotator SEO Tool.

Thread: 

Limit Number of Characters in Textarea or Text Field?

Ads
antony Offline referral

Posts: 478
Joined: Jul 2013
Reputation: 5

#1
Senior Member
I have created a textarea or as many call it text field and I am kind of wondering how can I limit the number of characters user can input into that field I would like to make 80 as the maximum characters you can input into text field or textarea?
gafsystem Offline referral

Posts: 7
Joined: Aug 2013
Reputation: 1

#2
Junior Member
Dear Antony,

You can do as follows

<textarea maxlength="80">
Enter text here...
</textarea>
antony Offline referral

Posts: 478
Joined: Jul 2013
Reputation: 5

#3
Senior Member
@gafsystem thanks very much is this maxlength supported by all web browsers?
gafsystem Offline referral

Posts: 7
Joined: Aug 2013
Reputation: 1

#4
Junior Member
(02-18-2014 04:41 PM)antony Wrote:  @gafsystem thanks very much is this maxlength supported by all web browsers?

Yes antony, All browsers support maxlength. However, this attribute can easily be removed/changed using DOM methods or, for example, with Firefox's Web Developer Toolbar.
surenot Offline referral

Posts: 500
Joined: Jan 2014
Reputation: 16

#5
Senior Member
@gafsystem is right about the fact that it's very easy to bypass "maxlength attribute" by simply edit source code using Firebug for instance! You need to create PHP validator that will check input characters length!
antony Offline referral

Posts: 478
Joined: Jul 2013
Reputation: 5

#6
Senior Member
Thanks guys PHP code is just no go for me as I am still struggling with HTML and CSS
victor Offline referral

Posts: 638
Joined: Jun 2013
Reputation: 33

#7
Senior Member
You should also create some kind of JavaScript form validator or PHP form validator to prevent people from changing maxlength property by editing HTML with the help of firebug.





User(s) browsing this thread: 1 Guest(s)