Oops wrong mailing list! -- please ignore. My apologies.

--
Louie Miranda ([EMAIL PROTECTED])
http://www.louiemiranda.net

Security Is A Series Of Well-Defined Steps
chmod -R 0 / ; and smile :)



On Thu, Dec 11, 2008 at 3:47 PM, Louie Miranda <[EMAIL PROTECTED]> wrote:

>
> Sorry to dig this up. But, maybe you could combine some of the codes
> and techniques here -- http://www.ajaxray.com/Examples/charLimit.html
>
> --
> Louie Miranda ([EMAIL PROTECTED])
> http://www.louiemiranda.net
>
> Security Is A Series Of Well-Defined Steps
> chmod -R 0 / ; and smile :)
>
>
> On Dec 12 2007, 9:36 pm, sidisinsane <[EMAIL PROTECTED]>
> wrote:
> > This is what I'm trying to do with a textarea.
> > 1. Limit number of characters
> > 2. Limit number of lines
> > 3. Diminish linelimit if characters in line exceed charlimit/linelimit
> > 4. Substract number of "lost" chararacters from charlimit if linebreak
> > ("\n") is provoked
> > 5. Disable input when either limit is reached
> >
> > So far I have managed to get 1, 2 and 5 (buggy) to work with the
> > following function. A demo can tested athttp://
> sidisinsane.com/sandbox/jquery/limitentry/
> >
> >         function limitEntry(txtid,infid,linelimit,charlimit)
> >         {
> >                 var txt = $('#'+txtid).val();
> >                 var txtlength = txt.length;
> >                 var line = txt.replace(/\s+$/g,"");
> >                 var split = line.split("\n");
> >                 var splitlength = split.length;
> >
> >                 if(splitlength > linelimit || txtlength > charlimit)
> >                 {
> >                         $('#'+infid).html('Your entry has reached its
> limit!');
> >                         $('#'+txtid).val(txt.substr(0,linelimit));
> >                         $('#'+txtid).val(txt.substr(0,charlimit));
> >                         return false;
> >                 }else{
> >                         $('#'+infid).html((linelimit - splitlength)+'
> lines and '+
> > (charlimit - txtlength)+' characters left.');
> >                         return true;
> >                 }
> >         }
> >
> >         $(document).ready(function()
> >         {
> >                 $(function()
> >                 {
> >                         $('#entry').keyup(function()
> >                         {
> >                                 limitEntry('entry','counter',5,100);
> >                         })
> >                 });
> >         });
> >
> > I've tried a couple of things but didn't quite manage to achieve my
> > goals. I could use some help on this one.
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to