Forum OpenACS Q&A: ETP and Richtext / HTMLArea problem

while trying to use ETP to edit the Content of a page
I get a javascript error that prevents the HTMLArea widget to be displayed (I use IE 6.0.3790).

The problem seems to be related to the form name (etp-edit)
and the minus sign that it contains.

Changing in etp-edit.adp the line:

<formtemplate id="etp-edit"></formtemplate>

with:

<formtemplate id="etp_edit"></formtemplate>

and in etp-edit.tcl the line:

ad_form -export { name attribute  widget} -form $form_list -edit_request {

with:

ad_form -name etp_edit -export { name attribute  widget} -form $form_list -edit_request {

seems to fix the problem.
I thought this could help others.

Just a little question. Is there a clean way to hide the B, I and URL buttons while using the HTMLArea richtext widget?

Regards,
Giampiero

Collapse
Posted by Orzenil Silva Junior on
hi Giampiero,

I had same problem using Mozilla 1.6 on Gnu/Linux. Your fix works good for me.

There's a open bug for Edit-this-page related to this feature. Maybe you could produce a patch and upload it to bugtracker, don't you?

Open bug is : link: #1615. editing a page fails with javascript error when HTMLarea is turned on

Thanks
Collapse
Posted by Giampiero Recco on
I have just uploaded a patch,
I hope it's in the correct format, it comes stright from my local cvs.

giampiero

Collapse
Posted by Malte Sussdorff on
Patch has been applied. Now ETP works smoothly with HTMLarea. Thanks for the patch.
Collapse
Posted by Jarkko Laine on
Just for further consideration, from "Developing with Web Standards" by Jeffrey Zeldman:
An id value must begin with a letter or an underscore; it cannot begin with a digit. The W3C validation service might not catch this error, but an XML parser will. Also, if you intend to to use an id with JavaScript in the form document.idname.value, you must name it as a valid JavaScript variable; that is, it must begin with a letter or an underscore, followed by letters, digits, and underscores. No blanks, and especially no hyphens, are allowed.
I guess that might be what was causing the problems here.
Collapse
Posted by Matthew Geddert on
I had a already submitted a bug report for this:

https://openacs.org/bugtracker/openacs/com/acs-templating/bug?bug%5fnumber=1906

if this is a limitation of javascript then this bug should be removed... if there are no possible work arounds... if there work arounds then it would be good if this were fixed on the htmlarea end of things because this isn't just a problem with etp, it shows up in other places too.