Capturing personal information

The first feature of our customer registration form application is to capture the title and first, middle, and last name of the customer. We will use a drop-down input component to capture the title. The name fields will be captured using the input text fields. The information will be captured in a model.

Let's start with the names fields as they are simple to implement. Add a model to the RegistrationForm module to capture the customer's first, middle, and last names. The attributes of the model must be Knockout observables for a two-way binding between the model and the view. We will call our model customer and add an attribute to group personal information. The model should look similar to this:

/* the model */ ...

Get KnockoutJS by Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.