PDA

View Full Version : CS101 Introduction to Computing Assignment No.02 Fall Semester April 2012



Vuhelper
04-28-2012, 08:26 PM
Assignment No. 02
Semester: Spring 2012
Introduction to Computing-CS101
Total Marks: 20

Due Date: 02-05-2012

Objective: To develop your own JavaScript functions and using them in form.

Instructions:
Please read the following instructions carefully before solving & submitting assignment:
Assignment should be in your own wordings not copied from internet, handouts or books.
It should be clear that your assignment will not get any credit (zero marks) if:

o The assignment is submitted after due date.
o The submitted assignment does not open or file is corrupt.
o The assignment is copied (from other student or copied from handouts or internet).
o Student ID is not mentioned in the assignment file or name of file is other than student ID.


GOOD LUCK


Question 1 [20 marks]

Make a form in HTML document containing only one field named as Email and one Submit Button. Write your own JavaScript function to validate the email address.

The Validation should be as follows:

1. It must accept only your VU Student email address i.e; it must not accept any other student’s VU email address.
2. It must show alert on acceptance or denial of the email address after validation.
3. The name of the function should contain your student ID like
4. If you enter your wrong student email id then it must show alert as well.
5. It must accept your student ID only at vu.edu.pk, means if you enter then it must not accept it.
6. There must be unique alerts for each error; like if the length of the student ID is larger or smaller than the original ID then the alert should be according to that.
7. During each alert, the entered email address must also be shown in the alert box like: “BC102034560000008@vu.edu.pk is not your Valid Email address”

Hint: See the attached sample html file for simply checking @ and dot in an email address.


Note:

o Assignment should be done by your own efforts, not copied from net, handouts or books.

o You should submit your html file as well as word file containing the code, zip the both files in one single file and upload via your assignment interface.