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:
outputs:$edit_form->{SQUIB_OUTPUT}=$q->textarea(-name=>'squib',-rows=>5,-colum +ns=>90,-wrap=>'virtual',-value=>$squib,-mce_editable=>1);
when I want it to output:<textarea name="squib" rows="5" cols="90" mce-editable="1" wrap="virtu +al"></textarea>
<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.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: CGI.pm tag attributes and underscores
by trammell (Priest) on Dec 15, 2004 at 21:29 UTC | |
by Hero Zzyzzx (Curate) on Dec 16, 2004 at 02:14 UTC | |
Re: CGI.pm tag attributes and underscores
by Hero Zzyzzx (Curate) on Dec 15, 2004 at 20:02 UTC |