Conditional Formatting on Calculated Values Not Working Consistently - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Conditional Formatting on Calculated Values Not Working Consistently

Last post 11-01-2017 11:35 AM by Michael Boonie. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 10-19-2017 02:37 PM

    Conditional Formatting on Calculated Values Not Working Consistently

    Hi. I've researched other posts that, at a glance, seem to be the problem I'm having; but my situation is more nuanced, I think.

    I have two fields--Contact Email and Contact Phone--that are duplicated in two sections. (This is because only one section at a time will ever be displayed, depending on a previous choice made by the user.) I have 'pattern-matching validation/formatting' applied to the associated text boxes, and this works fine.

    However, I also want to display a prompt under each text box when the format isn't correct, e.g. "ex: (111) 222-3333" (for an incorrectly formatted phone number) and "ex: someone@domain.com" for an incorrectly formatted email. In the past--indeed, elsewhere on the form--I use the technique wherein I enter the 'prompt text' as a Calculated Value control, so that I can apply conditional formatting (and so that it doesn't bugger the aesthetics by leaving a blank space when hidden.)

    The problem is that the conditional formatting doesn't appear to work with the calculated values in those two sections, yet it works elsewhere... usually. I can make it work reliably if I put the calculated text in a conditionally-formatted section all by itself, but that seems like overkill to conditionally hide four or five words.

    I can't find a pattern associated with the conditional text that works to compare with the conditional text that doesn't.

    Is there a more reliable and/or elegant method to doing this? Are there known issues with applying conditional formatting to controls that are in a section that also has conditional formatting? Are there best-practices I should be mindful of when, for example, binding (or not binding) a section to a Group in the schema? (For what it's worth, the sections that contain the conditionally-formatted calculated control that don't work AND the section containing similar calculated controls/prompts are bound to the top-level group, while the text boxes therein are actually in sub-groups below that, sometimes two levels deep.)
  • 11-01-2017 10:04 AM In reply to

    Re: Conditional Formatting on Calculated Values Not Working Consistently

    Well, I think I figured out this one... kind of. It seems that some of the Calculated Value controls had a "questionable" property configuration. When I compared the properties of the controls that didn't work with those that did, I noticed the faulty ones had no content in the "Text" property even though it displayed what I wanted (i.e. it HAD to have been entered sometime, somehow...) Anyway, when I (re-)entered the text to be displayed, all was then right with the world of conditional formatting... at least on this form.
  • 11-01-2017 11:21 AM In reply to

    Re: Conditional Formatting on Calculated Values Not Working Consistently

    Oh! I have seen this before when I copy / paste calculated values across views or between forms...
    Hilary Stoupa

  • 11-01-2017 11:35 AM In reply to

    Re: Conditional Formatting on Calculated Values Not Working Consistently

    Ah! That's exactly how I "created" a bunch of them. I guess this will be another one for the "Undocumented Features" column.
Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.