0% found this document useful (0 votes)
50 views2 pages

Cgs 3066: Spring 2015 Homework 3: Javascript Validation - 100 Points

This homework assignment has two parts worth a total of 200 points. The first part involves designing an HTML form with client-side validation using JavaScript. The form must validate that fields are filled, names only contain letters, emails are valid, phone numbers only contain numbers, and at least 3 options are selected for "You're best at". The second part involves building a basic calculator application using JavaScript with buttons for numbers, operations, trigonometric functions, and exponentiation to display calculation results. The assignment is due April 1st and submissions must be through the student's homepage, not email.

Uploaded by

Kelly Ortega
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
50 views2 pages

Cgs 3066: Spring 2015 Homework 3: Javascript Validation - 100 Points

This homework assignment has two parts worth a total of 200 points. The first part involves designing an HTML form with client-side validation using JavaScript. The form must validate that fields are filled, names only contain letters, emails are valid, phone numbers only contain numbers, and at least 3 options are selected for "You're best at". The second part involves building a basic calculator application using JavaScript with buttons for numbers, operations, trigonometric functions, and exponentiation to display calculation results. The assignment is due April 1st and submissions must be through the student's homepage, not email.

Uploaded by

Kelly Ortega
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

CGS 3066: Spring 2015

Homework 3
Total Points: 200
Due: Monday 04/01/2015
This is not an April Fools Day thing. Its real, despite being due on April 1st.
This assignment is on JavaScript its uses in client side validation and building small apps. The
assignment is in 2 parts and will also make use of HTML forms. You can also add CSS to customize
your page. Please note that I will not accept submissions through email. Your homepage should
have a link to the first of the two pages you have to write. If you have questions about setting up
your homepage, please see me during office hours to get it set up.

JavaScript Validation - 100 points.


For the first part of your assignment, youre required to design an HTML form and use JavaScript
to perform client side validation. This file should be calledform.html. Your form should look like
the image below. The action for the form, when the user clicks the Submit button, should take
you to the next page, which should be called calculator.html. You should be able to get to the
calculator only if all the requirements for the form are met.

The form should abide by the following rules:


No text-entry field should be empty.
Name fields should be text (a-z) only.
Email should be <id>@<domain>. For example, [email protected]. You have to use
JavaScript here, as the HTML5 input type email doesnt fulfil the requirement.
Phone number must be numeric only.
Youre best at field should have at least 3 options, and the user should be able to choose
one.

JavaScript App
The second part of your assignment is to develop a simple calculator using JavaScript. You should
use HTML form attributes here as well. You can get to this page only by entering valid data on
your form.html page and clicking the Submit button. Do not include a link to this page on your
homepage. The calculator should have the following features:
A text box to display the current number/result.
Buttons for numbers 0-9, organized like the standard calculator.
A button for the decimal point. This calculator should be able to handle floating point
operations.
Buttons for +, -, * and / operations.
Buttons for (exponentiation), sin, cos and tan. Values for trig functions can be assumed
to be in radians. Please dont confuse exponentiation with the exp function, which gives
you the valye of ex . Exponentiation should take 2 comma separated values x and y and
calculate xy .
An = button to display the result of the calculation.

You might also like