• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 462
  • Last Modified:

Infopath 2003 required field

I am new to Infopath.  I am attempting to design a form to collect data for a SQL Server 2005 table.  I have questions regarding Infopath and required fields.

In designing the Infopath form, a SQL Server database is used as the data source.  A SQL Server table’s field is used for a data source in a section containing 4 option buttons (i.e. “website”, “email”, “phone”, “in person”).  Depending on which option button is selected by the user, either “website”, “email”, “phone”, or “in person” will be what is imported in the SQL Server table’s field.   The 4 option buttons are in a “Repeating Section”, with the Repeating Section’s section properties set to not allow users to insert and delete the section.    There is not an option in the properties to make this a required field.

Under Tools > Submit Options > Rules, a rule has been added to show a dialog box message stating “Please complete question #1” if the user leaves the field blank.  It is also set to close the form after submit.

When the form was published to a public network drive, the message box does display if the user does not make a selection in the section, but the form is submitted and closed anyway.
How do I force the user to complete the section before the form is submitted to the SQL Server database table?
0
nulad
Asked:
nulad
  • 2
  • 2
1 Solution
 
janicet123Commented:
You can place conditional formatting on the Submit button to not be available if the required field is blank. There should, however, be an option on the Data Tab of the Option Button Properties that has a check box next to "Cannot be blank." It should be right above "Validation and Rules." If that isn't there, I would recommend the first option.
0
 
nuladAuthor Commented:
I have placed a submit button on the form.  I ran into a problem with the conditional formatting condition.  I want to make sure at least one check box is selected in a group of 7 check boxes (each check box is a database field).  It only allows 5 conditions.  Is there any way to add 2 more "and" lines to the one conditional statement?  It will not work correctly unless at least one check box out of the 7 check boxes is selected.
0
 
janicet123Commented:
Yes there is a quick way to do this. When you have your five conditions displayed in your conditional formatting box, change all of them to "The Expression". This will create an XPath that you can manually add on to. So in the picture, I had 5 conditions. I changed each of the items in the first drop down box to The Expression. It created my XPath and then I added my conditional qualifier "and" or "or" to the end. I then copied and pasted the second expression, added my conditional qualifier, added my third expression and so on. Once I had copied all of my expressions, I could delete the ones I had copied and add additional conditions on the lines below. I hope this makes sense. Please let me know if it doesn't and I will include additional Screen shots/
the-expression.png
the-expression2.png
0
 
nuladAuthor Commented:
Thank you so much.  It worked perfectly!
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now