td ({-style=>"foreground:red"}, escapeHTML("This is a required field")
+);
The HTML shortcuts take an optional first argument, a hashref with the elements attributes.
Or you could do:
td (span ({-class=>"required_field"}, escapeHTML("This is a required f
+ield")));
And use a style sheet to colour spans of class required_field red. Or you could give the table cell a class (or id) attribute. | [reply] [d/l] [select] |
Question #1 is, why are you doing an 'escapeHTML' on a plain-text string? Unless you're defanging arbitrary input, it's not very useful - and getting rid of it would make your life much easier.
Having said that, there is a (less-than-pretty) solution:
</p?
print td("font color='red'>".escapeHTML("required")."</font>");
--
I hate storms, but calms undermine my spirits.
-- Bernard Moitessier, "The Long Way"
| [reply] [d/l] |
This works, of course, but I want to make sure that the OP knows that using the font tag is very much deprecated in web design. Use the ideas later in this thread where an inline style (marginally preferable) or a CSS class (much preferable) is used along with an associated definition of the CSS class.
| [reply] |
http://w3schools.com/html | [reply] |
I must concur here with the other Anonymous. Using CGI to generate HTML tags is nothing more than a pain in the neck. Just embed the required HTML in your code using here-docs.
(Generating HTML tags largely makes sense only for form tags where whatever-you-are-using-to-generate-them is supposed to pre-fill the form with possible user input)
| [reply] |
| [reply] |
W3Schools may have huge SEO and come up almost any time you Google for a web design search, but please don't use it, nor recommend it. Here's why.
SEO? Search-engine-optimization?
Ok, that w3fools looks interesting, but yeah, I'm going to keep posting the w3 links, their presentation is good, even if the info has some problems, at least they don't complain about urls, and then say "this is lame, we told you" instead of adequately explaining, or providing a link
at least crockfords page is the 4th result for JavaScript
| [reply] |