Bonjour,

I'm trying to embed some javascript in ${mypub}/lenya/xslt/authoring/create.xsl There is already some script, which works fine, but now I would like to limit the length of the textareas.

This is my try:

function validLength(formField,fieldLabel, maxLength) {
 if (formField.value.length > 3) {
       alert('ohoh!');
   formField.focus();
   return false;
 }
 return true;
}

My problem is that the > sign gets mixed-up as it passes through the numerous xsl's (at least 4 of them)

So far, I have 2 solutions, but they don't satisfy me:

1) <TEXTAREA onkeyup="this.value = this.value.slice(0, 20)"></TEXTAREA>

2) externalize the javascript in a .js file and put it under /ressources

Anybody faced this already and has a solution?

Thanks,
Renaud

--
Renaud Richardet
Wyona Inc.  -   Open Source Content Management   -   Apache Lenya
[EMAIL PROTECTED]                   http://www.wyona.com


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to