If you set up the two sections (one for Male and one for Female), and place conditional formatting on each of them such that the Male one hides when the drop-down value is NOT male, and the Female one hides when the drop-down value is NOT female, then you are set.
Then if the drop-down value is BLANK by deault (i.e. not male nor female), then both sections will be hidden when the form is opened.
--
Greg Collins [InfoPath MVP]
Please visit:
http://www.InfoPathDev.com
Thanks Greg
It makes sense, and I was able to hide the section (this is an "Optional
Section" from the Controls task pane) using the conditional formatting.
However, what I want to do is have the section hidden when the from is opened
and when the user selects "Male" or "Female" from a drop-down list, the
corresponding section will open automatically. Is there an easy method for
me to accomplish this by using the Properties dialogs or will I need to write
a line of code/script to do it?
Thanks again, you are a great guide through this InfoPath jungle.
mdsmitty
Greg Collins said:
You are speaking of optional sections. Optional means that it either does or does not exist in the XML. If that is truly what you meant then you will need an OnAfterChange event handler that inserts or removes the section from the XML using code.
If the section is always going to be present in the XML, then this is not an optional section, but rather a conditionally visible section. That is much more simple. For this you add condtional formatting to hide the section unless the value of the specified field meats your criteria.
Does this make sense?
--
Greg Collins [InfoPath MVP]
Please visit:
http://www.InfoPathDev.com
Can you open an optional section automatically when a value is set in a field
or drop-down list? I want to select a value from a drop-down list and have a
corresponding optional section open automatically for the user to fill out.
Example: If I select "Male" from the drop-down list in my "Patient
Demographics" section then the "Male Physical Exam" optional section
automatically opens.