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

Q.1) Basic HTML Tags Welcome

The document contains questions and answers related to basic HTML tags, creating tables, frames, forms, and using CSS, JavaScript, and VBScript to add interactivity and functionality to webpages. It provides examples of code to create basic HTML pages with different tags and elements, add tables, frames, and forms, and manipulate the DOM using JavaScript, CSS, and VBScript for things like changing colors, sizes and positions of elements on mouse events.

Uploaded by

Debasree Paul
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
185 views

Q.1) Basic HTML Tags Welcome

The document contains questions and answers related to basic HTML tags, creating tables, frames, forms, and using CSS, JavaScript, and VBScript to add interactivity and functionality to webpages. It provides examples of code to create basic HTML pages with different tags and elements, add tables, frames, and forms, and manipulate the DOM using JavaScript, CSS, and VBScript for things like changing colors, sizes and positions of elements on mouse events.

Uploaded by

Debasree Paul
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 19

Q.

1) Basic HTML tags

<html>

<head>

<title>welcome to my first page</title>

</head>

<body>

<H1> <CENTER> Welcome to My Web Page </CENTER> </H1>

<HR SIZE=4 color="Blue" ALIGN="CENTER" WIDTH="40%">

<BODY TEXT = "990033"

<h1>Web Designing</h1>

<h2>Application creation</h2>

</P>

<center><img src="pgn.jpg "></center>

<p><font face="Monotype Corsiva" size="5" color="FF0000"><Marquee direction="right">"cute


birdie"</font></Marquee></p>

<p><font face="Monotype Corsiva" size="5" color="FF0000"><Marquee direction="alternate">"save


cute innocent birdies"</font></Marquee></p>

<font face="monotype corsiva" size="5" color="0000FF" <p align="justify"><U> "Life is not a bed of
roses".</U></font></p>

<font face="monotype corsiva" size="5" color="00ffFF" <p align="right"> <U>"Life is not a bed of
roses".</u></font></p>

<font face="monotype corsiva" size="5" color="ff0000 "<p align="left"> <B> "Life is not a bed of
roses".</B></font></p>

<font face="monotype corsiva" size="5" color="000000" <p align="center"><I><B> "Life is not a bed of
roses".</I></B></font></p>

<body BGCOLOR="660033">

<a href="frame4.html">PAGE1</font></a>

<a href="http://www.google.com">PAGE1</a>
<a href="form1.html"><img src="orch.jpg "></a>

</body>

</html>

Q.2) Webpage to display a table

</head>

<body>

<table border="2" cellspacing="6" cellpadding="2">

<tr>

<td><font color="ff00ff">this is my cell</font>

</td>

<td bgcolor="ffooff">

<font color="ffffff">this is my cell</font>

</td>

<td><font color="ffooff">debasree!!!<td>

<img border="3" src="pgn.jpg" width="128" height="103"</td>

</td>

</tr>

</table>

</body>

</html>
Q.3) Course details using frames

<html>

<head>

<title>my cool page,now with frames</title>

</head>

<frameset cols="50%,50%">

<frame src="tablecolor.html">

<frameset rows="20%,80%">

<frame src="tablepics.html">

<frameset rows="50%,50%">

<frameset rows="60%,20%">

<frame src="table.html">

<frame src="tablepics.html">

<frameset rows="50%,30%>

<frame src="table.html">

</frameset>

</frameset>

</table>

</body>
Q.4) Webpage to display a form

<html>

<head>

<title>Untitled Document</title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

</head>

<body bgcolor="#FF00FF">

<form method="post" action="" enctype="multipart/form-data">

<p>First name

<input type="text" name="textfield">

</p>

<p>Last name

<input type="text" name="textfield2">

</p>

<p>Gender: Male

<input type="radio" name="radiobutton" value="radiobutton">

Female

<input type="radio" name="radiobutton" value="radiobutton">

</p>

<p>Specialization: Finance

<input type="checkbox" name="checkbox" value="checkbox">

Systems

<input type="checkbox" name="checkbox2" value="checkbox">


Human Resource

<input type="checkbox" name="checkbox3" value="checkbox">

International Business

<input type="checkbox" name="checkbox4" value="checkbox">

Acturials

<input type="checkbox" name="checkbox5" value="checkbox">

Marketing <input type="checkbox" name="checkbox5" value="checkbox">

</p>

<p>Nationality </p>

<p>

<select name="select" size="4" multiple>

<option>Indian</option>

<option>American</option>

<option>Japanese</option>

<option>Chinese</option>

<option>African</option>

<option>Chillean</option>

<option>Britian</option>

</select>

</p>

<p>Attachments:

<input type="file" name="file">

</p>

<p>&nbsp;</p>

<p>
<input type="submit" name="Submit" value="Submit">

<input type="reset" name="Submit2" value="Reset">

</p>

</form>

</body>

</html>

Q.5) Write a CSS code which places text over image.

<html>

<head>

<style type="text/css">

img.x

position:absolute;

left:0px;

top:0px;

z-index:-1;

</style>

</head>

<body>

<h1>This is a heading</h1>

<h2>This is a Art Of Living</h2>

<h3>This is where peace is</h3>

<img class="x" src=" img.jpg" width="500" height="500">


<p>Default z-index is 0.Z- index-1 has lower priority.</p>

</body>

</html>

Q.6) Create the web page for animating the text.

<html>

<body>

<h1 onmouseover="style.color='red'"

onmouseout="style.color='green'">

Mouse over this text</h1>

</body>

</html>

Q.7) Create a web page which changes the size of the image on mouse actions.

<html>

<head>

<script type="text/javascript">

function changeSize()

document.getElementById("compman").height="250"

document.getElementById("compman").width="300"

</script>
</head>

<body>

<img id="compman"src="ind.JPG" width="107" height="98"/>

<br/><br/>

<input type="button" onclick="changeSize()" value= "change the height and width of the
image">

</body>

</html>

Q.8) Create a web page that moves an image in the document

<html>

<head>

<style type ="text/css">

body

background-image:

url('image.jpg');

background-repeat;

no-repeat;

background-attachment:

fixed

</style>

</head>

</body>
<p> the image will not scroll with the rest of the page</p>

<p> the image will not scroll with the rest of the page</p>

<p> the image will not scroll with the rest of the page</p>

<p> the image will not scroll with the rest of the page</p>

<p> the image will not scroll with the rest of the page</p>

<p> the image will not scroll with the rest of the page</p>

<p> the image will not scroll with the rest of the page</p>

<p> the image will not scroll with the rest of the page</p>

<p> the image will not scroll with the rest of the page</p>

<p> the image will not scroll with the rest of the page</p>

<p> the image will not scroll with the rest of the page</p>

<p> the image will not scroll with the rest of the page</p>

<p> the image will not scroll with the rest of the page</p>

<p> the image will not scroll with the rest of the page</p>

<p> the image will not scroll with the rest of the page</p>

<p> the image will not scroll with the rest of the page</p>

<p> the image will not scroll with the rest of the page</p>

<p> the image will not scroll with the rest of the page</p>

<p> the image will not scroll with the rest of the page</p>

<p> the image will not scroll with the rest of the page</p>

<p> the image will not scroll with the rest of the page</p>

<p> the image will not scroll with the rest of the page</p>

<p> the image will not scroll with the rest of the page</p>

Q.9) Create a form to get user input and validate it using JavaScript

<html>
<head>

<title>Create Form</title>

<script type="text/javascript">

function validate()

var name=document.formvali.name.value;

var phonenum=document.formvali.phone.value;

var email=document.formvali.email.value;

var experience=document.formvali.experience.selectedIndex; //selected index for validating


combo boxes//

if(empty(name,'Name')&& empty(phonenum,'phone')&& phone(phonenum,'phone no')&&


phonelength(phonenum,'phone no')&&empty (email,'email')&& checkmail()&&
mlist(experience,'Experience'))

document.formvali.submit();

//VALIDATION OF EMPTY FIELD

function empty(field1,field2)

if(field1 =="")

alert("The"+field2+"field is empty. Please re-enter the "+field2+".");

return false;

return true;

}
function mlist(field1,field2)//mlist-menulist

if(field1==0)

alert("Please select a"+field2);

return false;

return true;

//VALIDATION OF NUMBER

function phone(field1 , field2)

if(isNaN(field1))

alert("Reenter your"+field2)

return false;

return true;

function phonelength(field1 , field2)

if(field1.length<10)

alert("check the length of your"+field2)

return false;

}
return true;

//VALIDATION OF EMAIL ID

function checkemail()

if(document.formvali.email.value.indexOf('@')==-1)

alert("Check your email ID")

return false

return true

</script>

</head>

<body>

<p><u><b>Form Validation</b></u></p>

<form method="POST" action="thankyou.htm" name="formvali">

<p>

Name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

<input type="text" name="name" size="20"></p>

<p>Phone&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

<input type="text" name="phone" size="10"><br>

<br>

Email Id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

<input type="text" name="email" size="20"></p>

<p>Experience&nbsp;&nbsp;&nbsp;<select size="1" name="experience">


<option>Select</option>

<option value="1">1</option>

<option value="2">2</option>

</select></p>

<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>

<p><input type="button" value="Submit Form" name="B1" onclick="validate()"><br>

<br>

&nbsp;</p>

</form>

<p>&nbsp;</p>

<p>&nbsp;</p>

</body>

</html>

thankyou.htm

<html>

<head>

<title>Thank You Page</title>

</head>

<body>

<p>Thank you for your valid informations!!!!&nbsp;</p>

</body>

</html>

Q.10) Create a webpage that changes the foreground and background color using Vbscript.

<html>
<head>

<script type="text/javascript">

function bgChange(bg)

document.body.style.background=bg;

</script>

</head>

<body>

<b>Mouse over the squares and the background color will change!</b>

<table width="300" height="100">

<tr>

<td onmouseover="bgChange('maroon')"

onmouseout="bgChange('yellow')"

bgcolor="red">

</td>

<td onmouseover="bgChange('blue')"

onmouseout="bgChange('pink')"

bgcolor="yellow">

<td onmouseover="bgChange('green')"

onmouseout="bgChange('blak')"

bgcolor="pink">

</td>

</tr>

</table>

</body>
</html>

Q.11) Create a webpage to reverse the given string using Vbscript

<html>

<body>

<script type="text/vbscript">

sometext="Goodmorning Everyone!!"

document.write(strReverse(sometext))

</script>

</body>

</html>

Q.12) Write an ASP code for storing student information in to the database.

<html>

<head>

<title>Create Form</title>

<script type="text/javascript">

function validate()

var name=document.fotmvali.name.value;

var phonenum=document.formvali.phone.value;

var email=document.formvali.email.value;

if(empty(name,'Name')&& empty(phonenum,'phone')&&phone(pkonenum,'phone no')&&


phonelength(phonenum,'phone no')&&empty(email,'email')&&checkmail())

document.formvali.submit();

}
}

//VALIDATION OF EMPTY FIELD

function empty(field1,field2)

if(field1=="")

alert("the"+field2+"field is empty. Please re-enter the"+field2+".");

return false

return true;

//VALIDATION OF NUMBER

function phone(field1,field2)

if(isNan(field1))

alert("Reenter your"+field2)

return false;

return true;

function phonelength(field1,field2)

if(field1.length<10)

alert("check the length of your"+field2)


return false;

return true;

//VALIDATION OF EMAIL ID

function checkemail()

if(document.formvali.email.value.indexOf('@')==-1)

alert("check your email ID")

return false

return true

</script>

</head>

<body>

<p><u><b>Form Validation</b></u></p>

<form method="POST"action="insert.asp"name="formvali">

<p>

student

Name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

<input type="text"name="name"size="20"></p>

<p>student

phone&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

<input type="text"name="phone"size="10"><br>
<br>

Student

Email Id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

<input type="text" name="email" size="20"></p>

<p><input type="button" value="Submit Form"name="BI" onclick="validate()"></p>

</form>

<p>&nbsp;</p>

</body>

</html>

Creating Access Database

Insert.asp

<Html>

<head>

<% Dim adoCon 'Holds the Database Connection Object'

Create an ADO connection object

Set adoCon =Server.CreateObject("ADODB.Connection")

'Set an active connection to the connection object. Give the correct folder name and database
name

adoCon.Open "DRIVER={Microsoft Access Driver(*.mdb)};DBQ="&

Server.MapPath("Database/formvalidb.mdb")%>

</head>

<body>

<%

Name=Trim(request.form("name"))
phone=Trim(request.form("phone"))

email=Trim(request.form("email"))

set rs=adoCon.Execute("insert into user values("'&name&"',"'&email"')")%>

<table>

<tr>

<td colspan="2"height="350">

<div align="center">

<p><font color="#3333FF"><b>New user information is been inserted into the


database</b></font></p>

<p>&nbsp;</p>

<p><a href="student-info.htm">Home</a></p>

</div>

</td>

</tr>

</table>

</body>

</html>

You might also like