Join Gini von Courter for an in-depth discussion in this video Understanding the use of form controls, part of InfoPath 2013 Essential Training.
- View Offline
There are three basic types of controls that we're going to use in InfoPath, Input controls, used to capture text- based information from users; Object controls, used to capture things like Hyperlinks, and Pictures, and Items that users would Browse to; and Containers, used to group, Input and Object controls into useful organizational forms. I've created a simple form that we can use to illustrate how we work with all these different types of controls. So on the right I have a Field list. This is information that I want to capture from users.
So I'm going to use either Object controls, ore Input controls to be able to grab it. Remember that I can take a field like FirstName, drag it over here and drop it. And if I highlight right here in the center so I get both the Add label, and Add control cells, I'll actually get a Label Custom made for me, the InfoPath making it a little more friendly, inserting a space, and adding a colon (:) here. And in the same way I can go ahead and add my LastName control, both of those work just fine.
Now the controls that are placed to your are text controls, they are text boxes; this control right here. There are other controls I could use to capture text, but by default when I take a field that I've said contains Text and drag it out here on form I'm going to get a text box. I can point to a field over here to see what it says it is, and when we set the properties of this field originally, I actually chose text but (string) up here in parentheses (). So when you see the word (string), it means text. If I want to be able to see them all the time I simply turn on Show details here, and I'll be able to see that this is a date that this field is string, and so are the other two here.
When the control appears it has handles around it that allows me to move the control, or to change its size. If I want to move a control I simply select it, so if it's not selected already click once on it, and move my mouse so I have a four headed arrow and then I can go ahead and move this control somewhere else. Notice the label doesn't go with it it's created at the time I dragged this field onto the form, but they are not grouped together. Remember you can use Undo, Ctrl+Z, or you have a button up here to undo many of the changes you'l making InfoPath, but not all. And also because it has handles, I can resize it.
So I can drag to change its size, but I can't make it bigger than the cell it lives in. So if I wanted to make this name longer, I would actually have to create more space here for it by moving the column boundary between this column and the next column. Now I have another string field called Gender and I would actually like to be able to provide some guidance for my users. You would think that this would be a short and predictable list, but if I throw a gender field into a form and simply leave a blank, I'll get a lot of different information from folks, I will get man, and woman, male-female, and M, F, boy, girl.
So what I'd like to do is, I'd like in this case to not use the Existing Text Box that I'm going to get, the default for a (string), I'd actually like to use a DropDown list here. I have a couple of different ways to do that, one way is actually to click and to say I'd like to use a dropdown list. When I do that I get a new field here. I can change the way this control relates to this field, and say no look it up here, but that's not actually the easiest way to do this.
The easiest way to get the outcome that I want is to select the gender field and right drag it here into my form. When I do I release the mouse button, and I get a choice and there is my DropDown list box and I'll show you in a movie later in this chapter, how we would configure this list box to provide choices for users. If I want to remove control, all I have to do is select it and press Delete or Backspace on my keyboard and there it goes. Now I also have a Date field here, and I'm going to drag the Date field out into my form. Because it's a date rather than a (string) I am not getting the text box by default, I'm getting a Date Picker by default.
There might be times that I'd want to use a text box instead, or I would want to use a dropdown list, but the default for dates, is the Date Picker control. There is a relationship between the field here, and the control over here. So right now you'll notice that Today is highlighted, and so is the control I am using for Today. There's a little information box here with a blue highlight around it, and a small (=) equal sign in it; this is actually the binding setting for this control.
This control is bound to this field of data. LastName is bound to this field of data. So when I select something in the field list, it'll automatically select any control bound to it in the form. When I select in the form a particular control, the field that it's bound to its highlighted here in the list. So if I click here on field1 (string) you'll notice it's not bound to anything. Nothing lights up here. Insertion Point just hangs around someplace. So I'm going to delete this. When I do I'm prompted to be attentive to the fact that if I had a control, I am kind of making it an orphan, I am abandoning it in the form.
This is a Standard dialog you're going to see every time you delete a field, and we'll be deleting lots of them. So get used to it. You do one look and make sure that it's what you want to delete, because if you delete a field here you'll do some things that we can't undo. So I am going to simply click Yes, go ahead and get rid of that for me. One more thought: all of these fields have properties and we actually looked at those when we created the fields earlier. If I want to see the Properties for a field I can simply choose Properties and here's its name and its type, and its Data type, it's a date rather than for example text. I have certain set of Properties that are associated with the field.
I also have Properties associated with the control. So when I right-click for example on the Date Picker, notice Date Picker Properties, specific to this type of control. I have properties that dictate not just the data type but the format for that data type; how would I like this date to appear. I've Properties that influence the display. I can put a placeholder in that says choose a date for example. I can drag the handles to change the size of field, but I can also set it here. I can set padding within the cell that I would like to have.
I can provide some accessibility information, a screen tip so that if I have someone with visual disabilities working with this form, when their screen reader gets to this control it can provide some help information. And then some settings for browser forms that we will talk about later in the course. So we have Properties not just for fields, but also for controls as you'll find out later we have Properties for the form as well. If we're setting Properties in the Data field we're going to be doing things like Setting the Fields name, choosing a data type, determining whether its required, setting whether or not that particular field of data can repeat over and over again in the form, and determining how that data should be merged if we have multiple items and then we're sending that information back to the Data source.
Form controls on the other hand are where we determine binding, how the control is related to a particular field of data. Only one field of data can be bound to one control. The Format for the data: it's not just a date, it's a date where we're going to use the full name of the month spelled out. What's the default value for this field, if there is one? How do we validate this data if it's required in the data field? We also want to make sure in the control that we're saying we actually have to supply this information here in the control. How was it displayed, where is it, what size is it? And finally some Accessibility settings, and some web Browser settings.
So two different sets of Properties that we'll use to be able to setup our data and to be able to create a form that will be easy for users to use, and it provides validation as well as good access to our data. A lot to think about, lots of Properties. But as you work with InfoPath you will get really slick at creating the right settings in the right place to be able provide the user experience you want to provide.
- What is InfoPath?
- Creating a template from scratch
- Importing Word and Excel forms
- Creating and modifying data sources
- Adding and formatting a layout table
- Choosing a theme
- Working with form controls like date pickers and check boxes
- Using tables and sections for repeating data
- Publishing forms and templates
- Enabling digital signatures in a form