Well remember, if the user is submitting data(which they probably are)
to be processed by something on the server then it's not a good idea
to rely on server side prevention.  What I'm saying is if you're using
it in an sql query or something then the user can easily tweak the
html or just replicate the post form and take out the # characters
limit.  Best way is to check if it's >25 on the server.

Oh, and here's a link on how to limit # of characters in JS, so the
user doesn't have to submit to learn it's the wrong length.
http://www.felgall.com/jstip20.htm

On 6/11/07, Tobias Koller (GERMO GmbH) <[EMAIL PROTECTED]> wrote:
> The events "keyinput" or "keypress" are better than "keydown" I think ;)
> But I don't know if there's a way to manipulate the pressed key.
>
> Tobias
>
> -----Ursprüngliche Nachricht-----
> Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag von Tobias Koller 
> (GERMO GmbH)
> Gesendet: Montag, 11. Juni 2007 16:50
> An: qooxdoo Development
> Betreff: Re: [qooxdoo-devel] 0.6.6: maximum number of characters in TextArea
>
> Maybe you can catch the "keydown"-event and manipulate the value to null 
> before it is set to the textarea?
> Is this possible?
>
> Tobias
>
> -----Ursprüngliche Nachricht-----
> Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag von Daniel 
> Haferkorn
> Gesendet: Montag, 11. Juni 2007 15:22
> An: qooxdoo-devel@lists.sourceforge.net
> Betreff: Re: [qooxdoo-devel] 0.6.6: maximum number of characters in TextArea
>
> Hello Tobias,
>
> Tobias Koller (GERMO GmbH) wrote:
> > Hello,
> >
> > I think the main problem is, that there is no maxlength-attribute for a 
> > textfield in standard HTML.
> > A quick solution would be something like this:
> > var tarea = new qx.ui.form.TextArea();
> > tarea.set({width: 100, height: 100});
> > tarea.addEventListener("input", function(e){
> >       //check the length of your value
> > },this);
> >
>
> that is what I intend to do, with the event listener containing
> something like this (I have not tried this out as of yet!):
> if (tArea.getComputedValue().length > 25) {
>         tArea.setValue(tArea.getComputedValue().substring(0,
> tArea.getComputedValue().length - 1));
> }
>
> But this will most likely result in ugly flickering of the unwanted symbol.
>
>
> Regards,
> Daniel Haferkorn
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> qooxdoo-devel mailing list
> qooxdoo-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> qooxdoo-devel mailing list
> qooxdoo-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> qooxdoo-devel mailing list
> qooxdoo-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
qooxdoo-devel mailing list
qooxdoo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to