cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hepabolu <hepab...@gmail.com>
Subject Re: cforms + htmlarea bug
Date Sun, 19 Feb 2006 10:30:40 GMT
Hi,

AFAIK HTMLarea stopped being developed and Xinha has taken over. It's 
supposed to be backwards compatible but has an active community. Maybe 
replacing HTMLarea with Xinha already solves your problem:

http://xinha.python-hosting.com/

HTH

Bye, Helma


Leszek Gawron wrote:
> It looks like we have a bug concerning htmlarea widget in cforms. The 
> problem is following htmlarea code:
> 
> if (textarea.form) {
>     // we have a form, on submit get the HTMLArea content and
>     // update original textarea.
>     var f = textarea.form;
>     if (typeof f.onsubmit == "function") {
>         var funcref = f.onsubmit;
>         if (typeof f.__msh_prevOnSubmit == "undefined") {
>             f.__msh_prevOnSubmit = [];
>         }
>         f.__msh_prevOnSubmit.push(funcref);
>     }
>     f.onsubmit = function() {
>         editor._textArea.value = editor.getHTML();
>         var a = this.__msh_prevOnSubmit;
>         // call previous submit methods if they were there.
>         if (typeof a != "undefined") {
>             for (var i in a) {
>                 a[i]();
>             }
>         }
>     };
> }
> 
> which means that form's original onsubmit handler is being wrapper with 
> custom htmlarea code.
> 
> Problem: the code never gets executed as the form is not invoked from
> 
> <input type="submit" name="finish" value="finish"/>
> 
> but with <input type="button" onclick="forms_submitForm( 'finish' )"/> 
> (or something similar).
> 
> Result: textarea is not populated with htmlare code - you get an empty 
> textarea after submit.
> 


Mime
View raw message