CS101 - Introduction to Computing Assignment No. 2 Solution and Discussion Spring 2017 Due Date: May 22, 2017 

Assignment No. 02(Graded)
SEMESTER Spring 2017
CS101- Introduction to Computing

Total Marks: 20

Due Date: 22/5/2017



Please read the following instructions carefully before solving & submitting assignment:

It should be clear that your assignment will not get any credit (zero marks) if:

  • The assignment is submitted after due date.
  • The submitted assignment is other than .html.
  • The submitted assignment does NOT open or file is corrupted.
  • The assignment is copied (from other student or ditto copy from handouts or internet).


Uploading instructions

  • For clarity and simplicity, you are required to Upload/Submit only .html file.



The objective of this assignment is:

  • To understand the basics of html tables
  • To understand how to use interactive forms
  • To understand the concept of validation / check on different fields


For any query about the assignment, contact at cs101@vu.edu.pk


No assignment will be accepted after the due date via email in any case (whether it is the case of load shedding or internet malfunctioning etc.). Hence refrain from uploading assignment in the last hour of deadline. It is recommended to upload solution file at least two days before its closing date.


Suppose a university offers admissions in different disciplines. To facilitate far flung areas students, the administration decided to make an online webpage through which students can get registered online.  

  1. You as a web programmer need to design a webpage having an interactive form which will accept necessary bio data of the student.

The sample webpage shuold look like the following screen shot.

  1. Make some restriction or validation checks on all fields which make sure that no field can be left empty while pressing submit button. The  appropriat  message will be  shown in case of empty field as shown in the screen shot .

Note: No marks will be given if student does not mention his/ her name and VU ID at the top of the registration form.


Note: Use only Notepad to write html and JavaScript code. If any other tool is used, then zero marks will be awarded.



Views: 3903

Replies to This Discussion

<!-- CS101 ASSIGNMENT NO. 2-->
function chkfields() {
if (document.form1.fname.value<1)
window.alert("Name field empty! Please fill")

if (document.form1.cnic.value<1)
window.alert("CNIC field empty! Please fill")

if (document.form1.course.value<1)
window.alert("Course field empty! Please fill")

if (document.form1.session.value<1)
window.alert("Session field empty! Please fill")

if (document.form1.email.value<1)
window.alert("Email field empty! Please fill")

if (document.form1.pswd.value<1)
window.alert("Password field empty! Please fill")

if (document.form1.address.value<1)
window.alert("Address field empty! Please fill")

if (document.form1.gender.value<1)
window.alert("No gender selected! Please select ")

if (document.form1.city.value<1)
window.alert("City not selected! Please select")
<body bgcolor="#C3C3C3">
<h1 align="center">Student Name: ABC</h1>
<h2 align="center">Student Id: Bc1600000</h2>
<h3 align="center">Registration Form</h3>
<form name="form1">
<table border="0" width="512" align="center" bgcolor="#D7D7D7">
<td><input type="text" name="fname" id="name"></td>
<td><input type="text" name="cnic" id="cnic"></td>
<td><input type="text" name="course" id="course"></td>
<td><input type="text" name="session" id="session"></td>
<td><input type="email" name="email" id="email"></td>
<td><input type="password" name="pswd" id="pswd"></td>
<td colspan="3"><textarea cols="20" id="address"></textarea></td>
<tr colspan="2">
<td colspan="3"><input type="radio" name="gender" id="male" value="Male"> Male 
<input type="radio" name="gender" id="female" value="Female">Female</td>
<td colspan="3">
<select name="city">
<option value="">---Select--- </option>
<option value="faisalabad">Faisalabad</option>
<option value="lahore">Lahore</option>
<option value="islamabad">Islamabad</option>
<td colspan="2">
<input type="checkbox" name="new_student" value="nstudent"> New Student 
<td colspan="2"><input type="checkbox" name="con_student" value="constudent"> Continuing Student
<td colspan="2" align="right"><input type="submit" value="Submit" onClick="chkfields()"></td>
<td colspan="2" align="left"><input type="reset" value="Reset"></td>

Codding Attached

Thanks brother


Discussion Forum

CS101 assignment 2........Spring 2018

Started by mahira khan.
Last reply
by IqraZaib 3 hours ago. 2 Replies

Cs101 assignment solution

Started by Iqra Mubasher.
Last reply
by Muhammad Abdullah on Monday. 12 Replies

cs101 assingment solution 2018

Started by Muhammad Hasan.
Last reply
by + caмe4ѕтυdιeѕ May 9. 1 Reply

CS101 Assignment # 1 Due Date: 9th May, 2018

Started by + caмe4ѕтυdιeѕ.
Last reply
by + caмe4ѕтυdιeѕ May 8. 12 Replies


© 2018   Created by Muhammad Anwar Tahseen.   Powered by

Badges  |  Report an Issue  |  Terms of Service