Change control color when values in the control are changed

I

Ira

I want to change a control's (or section's) color whenever a change is made
to the existing value in that control - so that there is a visual cue that
the content in the form has been modified. Rules for conditional formatting
do not accomodate this condition and I am not certain if it can be done
programmatically using onafterchange and data validation. Thanks for your
help.
 
M

Mike Sharp

If you created a "flag" for each item that was changed in your onafterchange
event, you could test that condition in a separate template. Let's say I
have a <tr> tag in my view1.xsl that I want to set the background color for.

<tr style="MIN-HEIGHT: 0.333in">
<xsl:apply-templates select="my:SomeNodeChangedFlag"
mode="xd:preserve"/>

and your template would look like:

<xsl:template match="my:SomeNodeChangedFlag" mode="xd:preserve">
<xsl:if test=". = 'true' ">
<xsl:attribute
name="style">Background-color:red;</xsl:attribute>
</xsl:if>
</xsl:template>


Ideally, I think these would be best as an attribute, so your data node
would look like:

<my:someNode hasChanged="true">This content has changed<my:someNode>

Of course, the apply templates would have to select the @hasChanged node.

Regards,
Mike Sharp
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top