- Forums - Reply - Statistics - Sign Up - Search -

The Wyzz WYSIWYG Editor / Coding Discussion / 'maxlength' for textarea
Author Message
fonzman
Member
# Posted: 14 May 2009 22:11


Is it possible to limit the textarea, WYZZ provides, to a certain amount of letters?
I found this javacode, whicht does it for a normal <textarea>:

<script language="javascript" type="text/javascript">
<!--
function imposeMaxLength(Object, MaxLen)
{
return (Object.value.length <= MaxLen);
}
-->
</script>


and for the textarea in question set:

onkeypress="return imposeMaxLength(this, XXX);"

where XXX is the amount of letters you allow.

Can this be incorporated into WYZZ somehow? And if, where do I do this? I don't know anything about javascript-coding, and I don't want to break the whole thing ...

RGaba
Member
# Posted: 18 May 2009 21:22


My only question would be, since this is a WYSIWYG Editor, what are you basing the maxlength off of, they value they enter or the HTML that is rendered in the background?

I validate the size of the HTML that gets stored in the database using PHP and then return an error if it's too big.

RGaba
Member
# Posted: 2 Jun 2009 19:54


You can probably use something similar to this and just change the code so instead of displaying the number of characters return false.

www_wyzz_info/forum/index.php?action=vthread&forum =3&topic=126&page=0#2

Your answer

Bold Style  Italic Style  Underlined Style  Image Link  URL Link  Disable BB codes *What's that?

 » Name  » Password 
 Only registered users can post here. Enter your login/password correctly before posting a message, or register first.
 

Powered by miniBB forum software © 2001-2010