Hiding hint text when conditionally hiding a repeating or optional control

Certain controls, such as repeating and optional sections and repeating tables, will display a link that, when clicked, will insert a new item into the form. By default, the text of this link, which is called hint text, is “Insert item” for repeating controls and “Click here to insert” for optional sections.  This text can be customized or turned off completely through each of these control’s property dialogs.

In addition, the InfoPath Designer enables you to specify conditional formatting for these controls.  One of the actions that you can perform is to hide the control based on some condition.  When that condition is true, the control is hidden.  However, when the control is hidden, the hint text remains visible. This is often perceived as a bug in InfoPath but is actually by-design.

The reason behind this is simple and makes complete sense once you understand it.  Very simply put, each of the repeating controls allows you to set conditional formatting on a per-row basis.  This means that you can specify a condition that will hide a specific row and not the entire repeating table or all instances of the repeating section.

However, sometimes, especially in the case of optional sections, you wish to hide the entire control instead of just a single row.  The workaround for this is to put the control inside a section.  Then, set the condition which will hide the control on the section itself.  This will hide the section and all controls within it.