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

Collapse
Posted by Malte Sussdorff on
in /acs-templating/resources/forms/standard.adp:

<multiple name=elements>
        <if @elements.section@ not nil>
                <fieldset id="@elements.section@" @elements.sec_fieldset;noquote@><!-- section fieldset -->
        <legend @elements.sec_legend;noquote@><div id="form-legend">@elements.sec_legendtext@</div></legend>
        </if>

So I added a div id tag.

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 https://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.
Collapse
Posted by Don Baccus on
Please please please ask first before messing with this stuff, people.

Several folks spent a major percentage of their life earlier this year researching standards and implementing them as part of our zen effort. Don't make random willy-nilly changes!

Collapse
Posted by Malte Sussdorff on
Okay, I agree that people spend a major part of their live on it and this is great. Sadly the gained knowledge is not disseminated properly, allowing the mere mortals to run into issues like the one with legend, but others as well.

Latest experience is that IE7 does not display the richtext form widget at all if you upgraded your site. And yes, I am using the standard.adp as well as the forms.css provided by acs-templating. This happend on three sites so far, with clients where different people where responsible for the first design (otherwise it might have been my style of CSS coding).

Strangely it is also the case with certain packages. On one site it works perfectly fine for all packages, except lars-blogger.

THis is why I called for a new page to collect all the pitfalls that you might trap into when upgrading to 5.3.1. Because there seem to be many and at this point in time I can only warn people to upgrade if they have custom extensions. And though I don't mind being a guinea pig, my enthusiasm for 5.3.1 and the new and better CSS has been considerably dented the last week.

Once I get around to it I will write down all the things I found out. Sadly at the moment I do not have a fix apart from "Hey, this is the new design, it looks much better than the old one" and praying the client never asks the question "And can I get the old one back?"

Collapse
Posted by Lee Denison on
Hi Malte,

Can you email me the HTML for a page which doesn't display the richtext editor in IE7. I'd like to take a look at it to see if it is a problem with the changes I made to the master template.