Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General MS InfoPath Questions / March 2005

Tip: Looking for answers? Try searching our database.

Change control color when values in the control are changed

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ira - 22 Mar 2005 23:31 GMT
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.
Mike Sharp - 23 Mar 2005 04:15 GMT
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

> 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.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.