http://qs321.pair.com?node_id=415172

Hero Zzyzzx has asked for the wisdom of the Perl Monks concerning the following question:

Folks,

I use CGI.pm to generate all my form elements and the automagical stuff it does in the background is usually helpful, but not in this case.

I'm integrating a through-the-web WYSIWYG editor with a content management system. One way you can tell it to take control of a field is to add an attribute named "mce_editable" to a <textarea> tag. Unfortunately, CGI automatically turns "_" in attributes into hyphens.

So:

$edit_form->{SQUIB_OUTPUT}=$q->textarea(-name=>'squib',-rows=>5,-colum +ns=>90,-wrap=>'virtual',-value=>$squib,-mce_editable=>1);
outputs:
<textarea name="squib" rows="5" cols="90" mce-editable="1" wrap="virtu +al"></textarea>
when I want it to output:
<textarea name="squib" rows="5" cols="90" mce_editable="1" wrap="virtu +al"></textarea>

I'm not sure if "_" are valid in attribute names, and a quick glance at the HTML4 DTD didn't answer that question for me. I've also looked at the CGI.pm source and nothing jumped out at me.

Ideas? Any other options other than subclassing CGI.pm to make textareas work the way I want?

-Any sufficiently advanced technology is
indistinguishable from doubletalk.

My Biz