Welcome to WebmasterWorld Guest from 54.145.44.134

Forum Moderators: incrediBILL

Message Too Old, No Replies

limiting characters in a form field

limiting characters in a form field html

     

mylungsarempty

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

10+ Year Member



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.

mylungsarempty

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

10+ Year Member



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 Sep 7, 2003 (gmt 0)

10+ Year Member



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

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

jatar_k

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

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



<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 Sep 7, 2003 (gmt 0)

10+ Year Member



jatar_k, as far as I know maxlength unfortunately doesn't work in a textarea

jatar_k

7:52 pm on Sep 7, 2003 (gmt 0)

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



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

alright listen to gph not me, hehe. ;)

gph

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

10+ Year Member



Oh well, I could have just as easily made that mistake. May as well have both in the thread :)

kyr01

9:15 pm on Sep 7, 2003 (gmt 0)

10+ Year Member



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.

Purple Martin

4:08 am on Sep 8, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



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.

mylungsarempty

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

10+ Year Member



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```
 

Featured Threads

Hot Threads This Week

Hot Threads This Month