Ever design a form with 'The Blues'? You preview the form (or publish it out for your users) and it seems like no matter where you click on the form the whole form is selected, highlighted blue?
![Form with blue highlight Form with blue highlight](http://www.infopathdev.com/blogs/hilary/The%20Blues/TheBlues1.png)
This is, after all, pretty much an aesthetic issue. It doesn't really hurt anyone. But frankly, I find it annoying, and I bet you do too. And your users will very likely be at least perplexed. Fortunately, the fix is pretty straightforward. Here is a link to the simple sample form I'll be using for this post, in case you'd like to follow along at home.
First off, you will find that it is a repeating group or field causing your problem. You can find out which one by right-clicking on your blue highlighted section:
![Repeating "insert" right click Repeating "insert" right click](http://www.infopathdev.com/blogs/hilary/The%20Blues/TheBlues4.png)
Notice the "Insert group2" menu item? Taking a look at the data source for this form, we can see:
![Data Source Data Source](http://www.infopathdev.com/blogs/hilary/The%20Blues/TheBlues3.png)
And, if we look at our troublesome view in design mode:
![View in design mode View in design mode](http://www.infopathdev.com/blogs/hilary/The%20Blues/TheBlues2.png)
This form has a main section bound to the root of the data source, and then has a repeating group bound to a control that has been placed into that section. The 'insert' action for our repeating table is causing the problem in this sample -- repeating sections or repeating fields can also cause this problem. We have some choices: 1) place the repeating table inside another section to 'contain' the insert action or 2) take everything out of the section bound to the root node. Since I really like putting stuff in sections (if I don't I always regret it later -- I can almost bet there will be some reason I'll want to conditionally show / hide the section), I tend to take the first route:
![The Cure -- put the repeating section in another section The Cure -- put the repeating section in another section](http://www.infopathdev.com/blogs/hilary/The%20Blues/TheBlues6.png)
In this view, I've put the repeating section (bound to group2) into a new section that is bound to group1. I removed the borders from the section and set the margins and the padding to zero. When I preview this view, the table's insert event will highlight the section bound to group1:
![The cure -- preview The cure -- preview](http://www.infopathdev.com/blogs/hilary/The%20Blues/TheBlues5.png)
Unfortunately, this alone will not solve our problem. The section bound to the root node will still highlight. If you modify the binding of the main section, however, so it is connected to a field or group that does not contain a repeating group, your blues will be resolved:
![Main section bound to field Main section bound to field](http://www.infopathdev.com/blogs/hilary/The%20Blues/TheBlues9.png)
Another method is to take the repeating table out of sections entirely in the form:
![The Cure -- no sections The Cure -- no sections](http://www.infopathdev.com/blogs/hilary/The%20Blues/TheBlues7.png)
Make it a habit to tuck those repeating sections, tables and fields into non-repeating sections all by themselves, and you can lose the blues!