On Jan 18, 2005, at 4:29 AM, Marc Salvetti wrote:

Hello,

i've been asked to put a background color on the required fields in cforms, i don't really understand where i need to add the attribute.
I've been trying to edit forms-field-styling.xsl but
- I don't like the idea of updating a file coming from the distribution
well... :-)

- I don't find the right place in the file, i think it should be here but for some reason the attribute isn't added :

<!--+
| Handling the common styling. You may only add attributes to the output
| in this template as later processing might add attributes too, for
| example @checked or @selected
+-->
<xsl:template match="fi:*" mode="styling">
<xsl:apply-templates select="fi:styling/@*" mode="styling"/>
<!-- HERE -->
<xsl:attribute name="style">backround-color:yellow;</xsl:attribute>



That works for me. Actually I added this:

<xsl:if test="@required='true'">
<xsl:attribute name="style">background-color: yellow;</xsl:attribute>
</xsl:if>


However:

1) I had to play funny games w/ Cocoon to get it to "take". I hit the mysterious "Clear cache" sample page (mysterious to me, because I've never looked at what it actually does), and that didn't help. I renamed samples/blocks/forms/resources to resources.save, refreshed the page (getting the expected error from cocoon), and re-renamed it back again, then the change took effect. Me no understand, but oh well...

2) Not all browsers support all css properties in <input> elements, e.g. the background-color doesn't work in Safari... but it does in Firefox.

HTH,
—ml—


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to