Program 1,2 WT
Program 1,2 WT
Objective :Aim: Write HTML/Java scripts to display your CV in navigator, your Institute
website, Department Website andTutorial website for specific subject.
Related Theory :HTML?
Program Code :
<html>
<body style="backgroundcolor: white;">
<div style="position:absolute;top:110px;left:800px;color:red;">
<p>Muhammad Rehan Gull<br>Boostan colony, qainchee stop, main feerozpur road,
Lahore<br>03337172102<br>[email protected]</p>
</div>
<div style="paddingleft:0px;margintop:10px; ">
<h1 style="fontsize:
36pt;"><i><span style="color:orange;">Curriculum Vitae</i></h1>
<div style="paddingleft:
150px;margintop:
3px; ">
<h1 style="fontsize: 36pt;"><i><span style="color:green;">Muhammad Rehan
Gull</span></i></h1>
</div>
<div id="menu"
style="backgroundcolor:white;width:150px;height:700px;float:left;"></div>
<div id="content" style="backgroundcolor:
white;float:left;width:700px;height:1800px;">
<tr>
<td>MSC(IT) in progress</td>
<td></
td>
<td></
td>
<td>None</td>
<td>University of education, Lahore</td>
<td>University </td>
</tr>
<tr>
<td>B.COM</td>
<td>1500</td>
<td>787</td>
<td>B</td>
<td>Muslim college, muslim town lahore</td>
<td>Punjab University </td>
</tr>
<tr>
<td>F.Sc.</td>
<td>1100</td>
<td>612</td>
<td>B</td>
<td>Govt. college, burewala</td>
<td>Multan Board </td>
</tr>
<tr>
<td>MATRIC</td>
<td>850</td>
<td>696</td>
<td>A</td>
<td>Tabindah model high school, burewala</td>
<td>Multan Board </td>
</tr>
</table>
<hr>
<h1 style="fontsize:15pt;">TECHNICAL EXPERIENCE:</h1>
Platforms: Windows Seven,XP,98 Linux
Concepts: Networking, operating systems
<hr>
<h1 style="fontsize:
15pt;">ABILITIES:</h1>
Skill Level MS Word, MS Excel, Power point
practiced More than 1 years
<hr>
<h1 style="fontsize:
15pt;">PROFESSIONAL EXPERIENCE:</h1>
2 years experience as a Sales Representative in State <br>
1 year experience as a Sales Officer <br>
<hr>
<h1 style="fontsize:
15pt;">PERSONAL SKILLS:</h1>
1.Honesty<br>
2.Team Spirit<br>
3.Accepting Challenges
<hr>
<h1 style="fontsize:
15pt;">LANGUAGES:</h1>
Punjabi,Urdu,English
<hr>
<h1 style="fontsize:
15pt;">INTEREST:</h1>
1.Internet browsing
2.Reading books
<hr>
<h1 style="fontsize:
15pt;">REFERENCE:</h1>
Will be provided on demand</pre>
</div>
</body>
</html>
Outcome:To understand the web based language and uses of tags in developing web page.
Program2 :
Objective :Design HTML form for keeping student record and validate it using Java script.
Related Theory :The HTML <form> tag represents a form in an HTML document.
The <form> tag is used in conjunction with form-associated elements. To create a form, you typically nest
form-associated elements inside the opening/closing <form> tags. You can also use the form attribute within
those elements to reference the ID of the form to use.
Example :
Program Code :
<html >
<head>
<!--external javascript-->
<script typ="text/javascript" src="validation.js" >
</script>
</head>
<body>
<center>
<h1>Demo Registration Form</h1>
<form name="form1" method="post" action="success.html">
<table border='0'>
<tr>
<td><LABEL for="firstname">First Name:<sup
style="color:#F00">*</sup></LABEL></td>
<td><INPUT type="text" id="firstname"></td>
</tr>
<tr>
<td><LABEL for="lastname">Last Name:<sup
style="color:#F00">*</sup></LABEL></td>
<td><INPUT type="text" id="lastname"></td>
</tr>
<tr>
<td><LABEL for="gender">Gender:<sup
style="color:#F00">*</sup></LABEL></td><td><INPUT type="radio" name="gender"
value="Male"> Male
<INPUT type="radio" name="gender" value="Female"> Female </td>
</tr>
<tr>
</td>
</tr>
<tr>
<td><LABEL for="address" style="text-align:left;">Address:<sup
style="color:#F00">*</sup></LABEL></td>
<td><textarea id="address" name="address" rows="4" cols="20"></textarea>
</td>
</tr>
<tr>
<td><LABEL for="contctno">Contact Number:<sup
style="color:#F00">*</sup></LABEL></td>
<td><INPUT type="text" id="contctno"></td>
</tr>
<tr>
<td><LABEL for="email">Email:<sup style="color:red;">*</sup></LABEL></td>
<td><INPUT type="text" id="email"></td>
</tr>
<tr>
<td></td><td><br/><INPUT type="submit" onClick="return validateForm()"
value="Submit">
<INPUT type="reset" onClick="return confirmreset()"></td>
</tr>
<tr>
<td></td><td style="font-size:12px;text-align:right;"><br/><i
style="color:red;font-size:12px;align:right;" >* - Mandatory</i></td>
</tr>
</table>
</FORM></center>
</body>
</html>
var x=document.forms["form1"]["firstname"];
if (x.value=="")
{
alert("Please enter the First name.");
x.focus();
return false;
}
else if(x.value.length>20)
{
alert("First name cannot be greater than 20 characters.");
x.value="";
x.focus();
return false;
}
else if ((!namepattern.test(x.value)))
{
alert("First name should contain only alphabets.");
x.value="";
x.focus();
return false;
}
x=document.forms["form1"]["lastname"];
if(x.value=="")
{
alert("Please enter the Last name.");
x.focus();
return false;
}
else if(x.value.length>20)
{
alert("Last name cannot be greater than 20 characters.");
x.value="";
x.focus();
return false;
}
else if (!namepattern.test(x.value))
{
alert("Last name should contain only alphabets.");
x.value="";
x.focus();
return false;
}
if((document.form1.gender[0].checked==false)&&(document.form1.gender[1].checke
d==false))
{
document.form1.gender[0].focus();
alert("Please select a gender.");
return false;
}
vardd=document.form1.dd.value;
var mmm=document.form1.mmm.value;
varyyyy=document.form1.yyyy.value;
if(!validdate(dd,mmm,yyyy))
{
return false;
}
x= document.getElementById("address");
if(x.value==null || x.value=="" )
{
alert("Please enter the Address.");
x.value="";
x.focus();
return false;
}
else if(x.value.length<20)
{
alert("Address should be greater than 20 characters.");
x.value="";
x.focus();
return false;
}
x=document.form1.contctno;
if(x.value=="")
{
alert("Please enter the Contact number.");
x.value="";
x.focus();
return false;
}
else if(isNaN(x.value))
{
alert("Contact number should contain only digits.");
x.value="";
x.focus();
return false;
}
else if(x.value.length!=10)
{
alert("Contact number should contain only 10 digits.(Mobile number)");
x.value="";
x.focus();
return false;
}
else if(!phonepattern.test(x.value))
{
alert("Invalid Contact number.");
x.value="";
x.focus();
return false;
}
x=document.form1.email;
if(!emailpattern.test(x.value))
{
alert("Invalid email id.");
x.value="";
x.focus();
return false;
}
return false;
}
functionvaliddate(dd,mm,yyyy)
{
vardateobj = new Date(yyyy, mm, dd);
vardatecurrent= new Date();
if((dateobj.getMonth()!=mm)||(dateobj.getDate()!=dd)||
(dateobj.getFullYear()!=yyyy)||(dateobj>datecurrent))
{
alert("Please select a valid date.");
return false;
}
return true;
}
functionconfirmreset()
{
return confirm("Do you want to reset the form?");
}