homepage Welcome to WebmasterWorld Guest from 54.211.73.232
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / HTML
Forum Library, Charter, Moderators: incrediBILL

HTML Forum

    
limiting characters in a form field
limiting characters in a form field html
mylungsarempty

10+ Year Member



 
Msg#: 6109 posted 8:09 am on Sep 7, 2003 (gmt 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.

 

mylungsarempty

10+ Year Member



 
Msg#: 6109 posted 8:23 am on Sep 7, 2003 (gmt 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

10+ Year Member



 
Msg#: 6109 posted 7:38 pm on Sep 7, 2003 (gmt 0)

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

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

jatar_k

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



 
Msg#: 6109 posted 7:45 pm on Sep 7, 2003 (gmt 0)

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

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

gph

10+ Year Member



 
Msg#: 6109 posted 7:49 pm on Sep 7, 2003 (gmt 0)

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

jatar_k

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



 
Msg#: 6109 posted 7:52 pm on Sep 7, 2003 (gmt 0)

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

alright listen to gph not me, hehe. ;)

gph

10+ Year Member



 
Msg#: 6109 posted 8:04 pm on Sep 7, 2003 (gmt 0)

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

kyr01

10+ Year Member



 
Msg#: 6109 posted 9:15 pm on Sep 7, 2003 (gmt 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.

Purple Martin

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 6109 posted 4:08 am on Sep 8, 2003 (gmt 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.

mylungsarempty

10+ Year Member



 
Msg#: 6109 posted 7:15 am on Sep 8, 2003 (gmt 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```

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / HTML
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved