Forum OpenACS Development: Re: 5.3.1 forms and forms.css

Collapse
Posted by Emmanuelle Raffenne on
Malte,

The problem with adding DIV tag inside the LEGEND block is that it's not valid HTML 4.01 transitional. Pages containing forms that use sections, are not valid HTML anymore with this change.

You can specify the class to apply to the legend by passing a list of pairs (name value). See http://openacs.org/xowiki/Web_Forms for more info.

Also, a default style can be set if none is passed for legend along with the section definition.

Collapse
Posted by Malte Sussdorff on
Well, I am aware of that page and of it's capabilities. Sadly the did not work on my site. Did you try sections with the passing the class? If you did, can you give an example along with the CSS definition of the class. Preferably make the LEGENDTEXT with a grey background.

Nothing urgent though anymore as the client is happy with the new Boxing. Though still, it is an issue which needs to be addressed for site updating with not so forgiving users.

Collapse
Posted by Emmanuelle Raffenne on
Malte,

By default, when no style is defined for fieldset and legend, the fieldset has a border. The legend text appears in between fieldset borders. So, styles should be applied for both fieldset and legend to get what you want. I'm not a designer and I have very little knowledge with CSS but something like the following should work:

.fieldset-class {
border: 0px solid #FFFFFF;
border-top-width: 20px;
border-top-style: solid;
border-top-color: #DDDDDD;
}

.legend-class {
background: #DDDDDD;
font-weight: bold;
}

However, there's a style for fieldset in acs-templating/www/resources/forms.css that takes precedence and custom styles won't be applied:

.margin-form fieldset, .vertical-form fieldset, fieldset {
border: 0px solid #000;
}

We'll have to fix this for next release.

Collapse
Posted by Emmanuelle Raffenne on
Malte,

I've just fixed this and committed to oacs-5-3. Passing the class for fieldset and legend should work now.

Collapse
Posted by Tom Jackson on
It looks like the legend tag is like the title tag, h1, h2, etc. It should be inside a fieldset tag, and it can't contain any block elements. It looks like it can contain inline tags like b or i, although it is probably better to use an associated style. Can you use display: none; to remove it completely? Nice set of tags.