Instructions: Assignment No. 02 SEMESTER Spring 2017 CS101-Introduction To Computing Total Marks: 20 Due Date
Instructions: Assignment No. 02 SEMESTER Spring 2017 CS101-Introduction To Computing Total Marks: 20 Due Date
Instructions
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:
Uploading instructions
o For clarity and simplicity, you are required to Upload/Submit only .html file.
Objective
Note:
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.
2. 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.
SOLUTION:
<html>
<HEAD>
<SCRIPT>
function checkForm()
if(document.student.stName.value.length < 1)
if(document.student.CNIC.value.length < 1)
if(document.student.COURSE.value.length < 1)
{
window.alert ("please provide your COURSE");
if(document.student.SESSION.value.length < 1)
if(document.student.EMAIL.value.length < 1)
if(document.student.PASSWORD.value.length < 1)
if(document.student.ADDRESS.value.length < 1)
}
if(document.student.GENDER.value.length < 1)
if(document.student.STUDENTSTATUS.value.length < 1)
</SCRIPT>
</HEAD>
<BODY style="background-color:lightblue;">
<TABLE >
<FORM name="student" method="post" >
<TR>
<TR>
<TR>
<TR><TD>GENDER</TD>
<TD><INPUT TYPE= "RADIO" NAME="GENDER" VALUE="MALE"
>MALE
<TR><TD>CITY </TD>
<option value="LHR">LAHORE</OPTION>
<option value="PWR">PESHAWAR</OPTION>
<option value="QTA">QUETTA</OPTION>
<option value="KHI">KARACHI</OPTION>
</SELECT></TD></TR>
<TR>
<TR>
<TD>
<input type="SUBMIT"
name = "SUBMIT"
value= "SUBMIT"
onClick="checkForm()">
</TD>
</FORM>
</TABLE>
</BODY>
</html>
GOOD LUCK