Step 7: Collect user input and work with variables (tutorial)
So far, we've only added read-only items to our form. In this step, we'll introduce items that collect data from the user, and then we'll store that data in variables. Variables are, in a sense, the "engine" of NIM apps. They let us store state and get data where it needs to be.
We'll add 3 Input Text items to our form in consecutive rows, and set each item's column width to
6
.We'll set the properties of the first input text item as follows:
label mode: float
variable name: new_FirstName
label text: First Name
margin trbl: __3_
minimum length: 3
required: yes
validation message: User must have first name, with a minimum of 3 characters
Tip
The value that the user inputs into this field will be stored in the new_FirstName variable. As we'll see shortly, we can bind this variable to other objects in our app.
We'll set the properties of the second input text item as follows:
label mode: float
variable name: new_MiddleName
label text: Middle Name
margin trbl: __3_
We'll set the properties of the third input text item as follows:
label mode: float
variable name: new_LastName
label text: Last Name
margin trbl: __3_
minimum length: 3
required: yes
validation message: User must have last name, with a minimum of 3 characters
We'll click Save to save our progress so far.