Highlights
Assignment: Forms and Templates
Introduction
This assignment will give you an introduction to Node/Express templates, form handling, and validation. You will create a form that lists your sample products, and inputs the ID of the product to get more data about. You will then display a page giving details about that product.
Handlebars Template
You are to create a Handlebars template to create a common look for all of the pages on your site. At a minimum, it should have your company name/logo at the top and your name at the bottom:
.png)
Product Lists
For each of the pages described below, you will need to represent your sample products as an array of objects that gives the value of each field of your products. That is, something of the form:
.png)
You will also need code to search this array to get the object corresponding to a particular ID.
This code can be in your application for now, or you could put it in a separate file containing model functions if you would like to work ahead.
Product Selection Page
You are to create a Handlebars view for a “product selection page”. This page should:
.png)
Listing Products
Your application should pass your product list to the view. The view should then loop through that list, displaying the name of each product and its corresponding ID as shown above.
Selecting Products
You are also to provide a text element for the user to enter one of the IDs listed above. When they press the Get Details button that ID is to be passed to the application.
(Note that this is not the best way to have a customer select products. We will improve on this in the next assignment).
Using Form Data
When the above form is submitted, your application is to do the following:
Product Detail Page
This Handlebars view displays detailed information about the product passed to it:
.png)
Rather than having a separate static page for each product (as you did in the previous assignment), this will be a single page generated dynamically from the fields of the object passed to the view.
Validation
You are to validate that the user entered a legal ID into the form (that is, one that exists in your list of objects).
If they did not, rather than going to the product details view you should redisplay the product selection page, with a message stating that is not a valid ID.
You are also to echo back (that is, redisplay) the ID they entered previously.
For example, if the user enters 12345 as the ID, and 12345 is not a valid ID, the product selection page would be redisplayed as follows:
.png)
Note that this means your search will need to handle the case of an ID not in the list of objects.
Other Error Handling
Your application should still do the same basic error handling as before:
Additional Requirements
What to Turn In
You are to compress (using a program such as gzip) your entire application directory into a single file.
Turn this file in using the Blackboard link.
This CSCI 4862/6962-IT Computer Science Assignment has been solved by our IT Computer Science Experts at My Uni Paper. Our Assignment Writing Experts are efficient to provide a fresh solution to this question. We are serving more than 10000+ Students in Australia, UK & US by helping them to score HD in their academics. Our Experts are well trained to follow all marking rubrics & referencing Style. Be it a used or new solution, the quality of the work submitted by our assignment experts remains unhampered.
You may continue to expect the same or even better quality with the used and new assignment solution files respectively. There’s one thing to be noticed that you could choose one between the two and acquire an HD either way. You could choose a new assignment solution file to get yourself an exclusive, plagiarism (with free Turn tin file), expert quality assignment or order an old solution file that was considered worthy of the highest distinction.
© Copyright 2026 My Uni Papers – Student Hustle Made Hassle Free. All rights reserved.