[Seaside] Default classes for form input tags?

Lukas Renggli renggli at gmail.com
Thu Aug 10 05:40:16 UTC 2006

> > Why is it that form fields get their class initialized by default
> > to match
> > their type in
> >
> > WAFormInputTag>>with: aBlock
> >  self type isNil ifFalse: [
> >   self attributes at: 'type' ifAbsentPut: [ self type ].
> >   self class: self type ].
> >  super with: aBlock.
> >
> > I find it very odd that Seaside would try to impose any classes
> > onto the
> > developer, same applies to WAListTag>>with: and these are the only
> > two cases
> > I could find.
> I don't remember when that change was made, or what the specific
> reason for it was.  I can say, however, that it's a pretty useful
> thing to have, in that it lets you use selectors like input.text or
> input.password in your CSS...

The reason I added that, was because IE does not support conditions
(input[type="text"] or input["button"]) in CSS selectors. If you have
the type as a class you can easily do the same in a cross platform way
(input.text or input.button), though it requires that your CSS
designer does not use selectors like .text but something more specific
like div.text if you have a conflict.


Lukas Renggli

More information about the Seaside mailing list