0% found this document useful (0 votes)
6 views

Program 1,2 WT

Project for B.tech

Uploaded by

anaasahu20
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

Program 1,2 WT

Project for B.tech

Uploaded by

anaasahu20
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 10

Program 1 :

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?

HTML is a markup language for describing web documents (web pages).


 HTML stands for Hyper Text Markup Language
 A markup language is a set of markup tags
 HTML documents are described by HTML tags
 Each HTML tag describes different document content
HTML Structure
Delimiters: <, >, /
Delimiters surround the tag and inform the parser that it should read the enclosed information as an HTML
element.
Tags:
Tags contain elements which provide instructions for how information will be processed or displayed. There
are both starter tags <TAG> and end tags </TAGS>
Elements:
A basic unit of an HTML document. The name of the element is given in the name of the tag, and specifies the
meaning associated with a block of text. Some elements are empty since they don't effect a block of
text. Elements that have contents are also called containers, i.e., they contain attributes.
o Example: the <HR> tag contains the Horizontal Ruler element. It is an empty element in that
it has no attribute.
Attribute:
Defines a special property of an HTML element.
o Example: <IMG SRC="image.gif"> means that the element IMG has an attribute SRC, which
specifies the name of the image file, which is assigned the value "image.gif".
HTML is a structured hierarchical language that requires you to follow its rules if you wish your documents to
appear correctly. For example, certain elements and tags are required to fit within other elements and tags
and will not work unless they are properly placed.

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;">

<pre><h1 style="fontsize: 25pt;">CAREER OBJECT:</h1>


To be the part of an energetic organization and utilize my knowledge,Skills
and expertise to contribute towards organization and professional
Brilliance.<br>and to learn more with the passage of time from all<br>types of
situations and circumstances <hr>
<h1 style="fontsize: 25pt;">EDUCATION AND QUALIIFICATIONS:</h1>
<table ">
<tr>
<th>Qualification</th>
<th>Maximun Marks</th>
<th>Obtained Marks</th>
<th>Division</th>
<th>Institution</th>
<th>Bord/University</th>
</tr

<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.

Application:1.In design of web pages


2. For making information based web pages like resume, college information, computer
language information pages.

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 :

<form action="process_form.cfm" method="get">


Form-associated elements here...
</form>
<form action="process_form.cfm" method="get">
<label>First Name: <input name="first_name"></label>
<label>Last Name: <input name="last_name"></label>
<input type="submit" value="Submit">
</form>

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><LABEL for="dob">Date of Birth:<sup


style="color:#F00">*</sup></LABEL></td>
<td>
<select id="dd">
<option value="dd">DD</option>
<script type="text/javascript">
for(vari=1;i<32;i++)
document.write("<option value='"+i+"'>" + i+"</option> ");
</script>
</select>
</select>
<select id="mmm">
<option value="mmm">MMM</option>
<option value="0">JAN</option>
<option value="1">FEB</option>
<option value="2">MAR </option>
<option value="3">APR</option>
<option value="4">MAY</option>
<option value="5">JUN</option>
<option value="6">JUL</option>
<option value="7">AUG</option>
<option value="8">SEP</option>
<option value="9">OCT</option>
<option value="10">NOV</option>
<option value="11">DEC</option>
</select>
<select id="yyyy">
<option value="yyyy"selected>YYYY</option>
<script type="text/javascript">
vardt= new Date();
for(vari=1979;i<=dt.getFullYear();i++)
document.write("<option value='"+i+"'>" + i+"</option> ");
</script>
</select>

</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>

JAVA SCRIPT code for Validation


functionvalidateForm()
{

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;
}

if(confirm("Do you want to submit the form?"))


{
alert("Registration Form Submitted Successfully.");
}
else

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?");
}

Demo Registration Form

Outcome: To understand the validation of working of login page.

Application:Can design interactive form to enter user’s detail


1. Maintaining student record

2. Managing faculty information.

You might also like