perlquestion
Hero Zzyzzx
<p>Folks,</p>
<p>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.</p>
<p>I'm integrating a through-the-web <a href="http://tinymce.moxiecode.com">WYSIWYG editor</a> 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.</p>
<p>So:</p>
<code>
$edit_form->{SQUIB_OUTPUT}=$q->textarea(-name=>'squib',-rows=>5,-columns=>90,-wrap=>'virtual',-value=>$squib,-mce_editable=>1);
</code>
outputs:
<code>
<textarea name="squib" rows="5" cols="90" mce-editable="1" wrap="virtual"></textarea>
</code>
when I want it to output:
<code>
<textarea name="squib" rows="5" cols="90" mce_editable="1" wrap="virtual"></textarea>
</code>
<p>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.</p>
<p>Ideas? Any other options other than subclassing CGI.pm to make textareas work the way I want?</p>
<!-- Node text goes above. Div tags should contain sig only -->
<div class="pmsig"><div class="pmsig-59531">
<p align="right"><font size=1 face="Verdana, San Serif"><b> -Any sufficiently advanced technology is<br> indistinguishable from doubletalk.</b></font></p>
<p align="right"><font size=1 face="Verdana, San Serif"><a href="http://www.geekuprising.com">My Biz</a></font></p>
</div></div>