Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

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


In reply to CGI.pm tag attributes and underscores by Hero Zzyzzx

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2024-04-19 05:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found