CS412
Fall 2024

Assignment 2: Introduction to HTML Forms

due by 9:00 p.m. EDT on SEPTEMBER 16, 2024

Preliminaries

In your work on this assignment, make sure to abide by the collaboration policies of the course.

If you have questions while working on this assignment, please post them on Piazza! This is the best way to get a quick response from your classmates and the course staff.

Learning Objectives

After completing this assignment, students will be able to:

Task 1: Writing an HTML Form

In this task, you will create an HTML form to implement a simple survey questionnaire. The subject matter of the survey questions is entirely up to your choice. The survey must contain one or more of each of these form input elements: e.g., text box, radio buttons, check boxes, drop-down list.

Here is a sample output (in the web browser):

Your goal is not to reproduce this exact form, but rather to create a form on a subject that interests you.

Use VS Code to create a new HTML file, and save it with the special name survey.html. As you develop your web page, get in the habit of including comments to explain each major section, and make notes to explain anything that is confusing.

  1. Form Submission

The most challenging part of the form will be submitting the form to the server for processing. Work on this first! Create a simple form with a single text box for the respondent’s name and a submit button.

Submit your form to the web application located at: https://cs-webapps.bu.edu/cgi-bin/util/formmailer.py

We will discuss/demonstrate the form submission in class on Thursday 9/12.

In addition to the fields described below, your form must have a submit button (labeled “Submit”), and a hidden form field named mailto, which will contain your email address (i.e., so that the form submission will be sent to you as an email).

  1. Additional Form Fields

Make sure you get part 1 to work before you begin part 2! Add some text before the form giving the user instructions and describing what the survey will do.

Your form should be neatly formatted with well-aligned cells. Use a <table> to wrap the form fields and get them to line up neatly.

Your form must ask several survey questions (as many as you like), so long as you use all of the following form fields:

Task 2: Publishing Your Web Page

Transfer your files to the web server to get them to display on the public World-wide Web.

This task is illustrated in the example videos about publishing your web page. Use a file-transfer program (WinSCP or Fetch) to upload the files. Set the permissions accordingly, to UNIX code 755 (rwxr-xr-x). * Test by viewing your web page in the browser.

The page should be visible using this URL: http://cs-people.bu.edu/username/ where you replace username with your BU username.

Important Notes

  • The UNIX file system is case-sensitive with respect to file names. Your image file name and the src used in the image tag must agree, including the file extension. .JPG and .jpg are considered different!

Submitting Your Work

50 points; will be assigned by code review

Log in to GradeScope to submit your work.

Be sure to name your files correctly!

You must submit at least 3 files to gradescope:

  1. Your survey.html file and styles.css file. Include any ancillary files (e.g., images) that you use in your web page.

  2. A text file a2_url.txt, containing the URL to your web page, and nothing else. For example: http://cs-people.bu.edu/azs/survey.html.

    This file will be used by the autograder to locate your web page, so you must get the URL exactly correct, and you must not include any other text or code in the file.

Notes: