Welcome to WebmasterWorld Guest from 54.144.107.83

Forum Moderators: incrediBILL

Message Too Old, No Replies

limiting characters in a form field

limiting characters in a form field html

     
8:09 am on Sep 7, 2003 (gmt 0)

Full Member

10+ Year Member

joined:July 11, 2003
posts:232
votes: 0


Yeah, i know this is simple, and i've seen it before, but now that i actually have a need for it, i can't seem to find a site that plainly says "this is how you do this". I want to limit the number of characters a user can enter into a textarea. What is the HTML code with which to do this? Or am i mistaken, is it Javascript code... thanks.
8:23 am on Sept 7, 2003 (gmt 0)

Full Member

10+ Year Member

joined:July 11, 2003
posts:232
votes: 0


another simple question. Is there a way to put a border around a link the way that could be done with an image?

gph

7:38 pm on Sept 7, 2003 (gmt 0)

Full Member

10+ Year Member

joined:Jan 31, 2002
posts:285
votes: 0


1) [solidscripts.com...]
(mods I have no affiliation with the site)

2) <a style="border: 1px solid">link</a>

7:45 pm on Sept 7, 2003 (gmt 0)

Administrator

WebmasterWorld Administrator jatar_k is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:July 24, 2001
posts:15755
votes: 0


<input type="text" name="field1" size="10" maxlength="25">

no need for js, it is set in the form element.

gph

7:49 pm on Sept 7, 2003 (gmt 0)

Full Member

10+ Year Member

joined:Jan 31, 2002
posts:285
votes: 0


jatar_k, as far as I know maxlength unfortunately doesn't work in a textarea
7:52 pm on Sept 7, 2003 (gmt 0)

Administrator

WebmasterWorld Administrator jatar_k is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:July 24, 2001
posts:15755
votes: 0


hehe, good point, I should really pay more attention when I read.

alright listen to gph not me, hehe. ;)

gph

8:04 pm on Sept 7, 2003 (gmt 0)

Full Member

10+ Year Member

joined:Jan 31, 2002
posts:285
votes: 0


Oh well, I could have just as easily made that mistake. May as well have both in the thread :)
9:15 pm on Sept 7, 2003 (gmt 0)

Junior Member

10+ Year Member

joined:Jan 28, 2003
posts:129
votes: 0


The point is: if you really need to limit the number of characters for security reasons, then you better do it at server level, using php or your favorite language. Client side verification using javascript can easily be disabled, and it is not safe to rely on it.
4:08 am on Sept 8, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Jan 21, 2002
posts:977
votes: 0


I like to verify at both client side and server side. Client side saves the user from an unnecessary redirect, server side cathes the few that get through if the user's JavaScript is turned off.
7:15 am on Sept 8, 2003 (gmt 0)

Full Member

10+ Year Member

joined:July 11, 2003
posts:232
votes: 0


Thanks so much for the help. It isn't so much for any security reasons -- just something to limit the non-paying members of my site in their descriptions. Thanks a million```
 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members