Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > JavaScript > Re: Limit <text...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 8 of 8 Topic 35542 of 37484
Post > Topic >>

Re: Limit <textarea> length without losing caret position

by Dr J R Stockton <jrs@[EMAIL PROTECTED] > May 9, 2008 at 10:35 PM

In comp.lang.javascript message <7c50f285-c43f-4f29-9d36-b4bb5ae7a922@[EMAIL PROTECTED]
>, Fri, 9 May 2008 05:07:21, Laser Lips
<loudsphiers@[EMAIL PROTECTED]
> posted:

The advice of anyone who posts this code

>function cutLength(e,el,max)
>{
>       if(el.value.length>max)
>       {
>               return false;
>       }else{
>               return true;
>       }
>}

rather than

function cutLength(e, el, max) { return el.value.length <= max }

is unlikely to be worth considering.

-- 
(c) John Stockton, nr London UK.  ???@[EMAIL PROTECTED]
  Turnpike v6.05 
MIME.
 Web  <URL:http://www.merlyn.demon.co.uk/>
- FAQish topics, acronyms, &
links.
     Check boilerplate spelling -- error is a public sign of incompetence.
    Never fully trust an article from a poster who gives no full real
name.
 




 8 Posts in Topic:
Limit