[Catalyst] HTML::Widget styling

Nigel Metheringham Nigel.Metheringham at dev.intechnology.co.uk
Fri Jul 28 18:31:04 CEST 2006


[Please point me to the right place if there is a better place for
HTML::Widget questions]

If I have a simple form of mixed elements produced in HTML::Widget, all
the components of the HTML output have ID tags, and the actual INPUT
elements have classes (corresponding to the type - which is actually
superfluous since you can style them using something like a CSS
'input[type=submit' selector).   

However there is no good way of selecting labels which go with
particular types of INPUT element - for example I might (and do!) wish
to differently style checkbox labels to those for text elements.

By default labels have no class - unless there is an error in form
validation.

I can't work out a good way to generically style checkbox (or select
or...) labels.  My CSS fu is not that wonderful, so maybe I have missed
something...

I have produced a hack which overloads mk_label and adds a default class
to each label, but frankly its not good since it will all fall apart if
there is a validation error (which overrides the label class).

Any solutions or ideas?

[I did wonder about hacking the HTML production to wrap every element
group (ie label & input element) with a div of appropriate class - but
that feels messy too (and even messier to implement, I think)].

	Nigel.
-- 
[ Nigel Metheringham           Nigel.Metheringham at InTechnology.co.uk ]
[ - Comments in this message are my own and not ITO opinion/policy - ]




More information about the Catalyst mailing list