Sample Program 5!

Okay Guys. This program will have two html pages. You have to save them in the same folder.

First Page:

<html>
<body bgcolor=”black” text=”white”>
<form action=”ThankYou.html”>
<h1><center><u> Want To Know More? </u></h1><hr><hr></center<
<br><br><u><center> Please Login </u></center><br><br>
<center>
<table border=4>
<tr>
<td> UserName: </td>
<td> <input type=”text”> </td>
</tr>
<tr>
<td> Password: </td>
<td> <input type=”password”> </td>
</tr>
</table></center>
<br>
<center>
<input type=”submit” value=”Submit”>
</center>
</table>
</form>
</body>
</html>

Save this as Main.html 

Second Page:

<html>
<head>
<title> Thank You </title>
</head>
<body bgcolor=”black” text=”white”>
<h1><center><font size=7 face=”chiller”><u> You Have Now Gained Full Access To The WEBSITE </u></center></h1></font>
</body>
</html>

Save this as ThankYou.html  

You have to save the pages as I’ve mentioned or this program will not work!

Advertisements
Categories: Uncategorized | Leave a comment

Forms (Important)

The <form> tag is used to create an HTML form for user input.

Imagine this – You have a page asking you to type your username and password. There is also a submit button. Now you want to make sure that on the click of the submit button a thank you page opens, you use the form tag.

<form action=”FileName.html”>

</form>

The action attribute specifies where to send the form-data when a form is submitted. My next post will be an example.

Optional Attributes

Attribute Value Description DTD
accept MIME_type Specifies the types of files that the server accepts (that can be submitted through a file upload) STF
accept-charset character_set Specifies a list of character encodings that the server accepts STF
enctype application/x-www-form-urlencoded
multipart/form-data
text/plain
Specifies how the form-data should be encoded when submitting it to the server (only for method=”post”) STF
method get
post
Specifies the HTTP method to use when sending form-data STF
name name Specifies the name of a form TF
target _blank
_self
_parent
_top
framename
Deprecated. Specifies where to display the response that is received after submitting the form TF

 

 

Categories: Uncategorized | Leave a comment

Sample Program 4

<html>
<head>
<title> MegaShopping </title>
</head>
<body>
<center><h1> MEGA SHOPPING </h1></center>
<fieldset>
<legend> Contact Details </legend>
<table>
<tr>
<td> Enter Name: </td>
<td> <input type=”text”></td>
</tr>
<tr>
<td> Age: </td>
<td> <input type=”text”</td>
</tr>
<tr>
<td> Gender: </td>
<td> <input type=”radio” name=”check” selected> Male &nbsp; <input type=”radio” name=”check”> Female </td>
</tr>
<tr>
<td> Occupation: </td>
<td> <select>
<option> Student </option>
<option> Engineer </otpion>
<option> Doctor </option>
</select> </td>
</tr>
<tr>
<td> Telephone No: </td>
<td> <input type=”text”> </td>
</tr>
</table>
</fieldset><br>
<center>
<input type=”submit” value=”Submit”>
</center>
</body>
</html>

Categories: Uncategorized | Leave a comment

The Fieldset and Textarea Elements.

The fieldset element allows the web page designers to group the related content and controls within a structure. This helps the web page designers to divide the page into multiple sub-parts while working with many form controls.

The fieldset element contains the legend element that assigns a caption to a group of controls!

The syntax is

<fieldset>
<legend> Caption Here </legend>
Your Text
</fieldset>

As the name suggests, the textarea element creates a textarea. It’s more like the area where you type in your feedback for a website!

It’s a simple syntax.

<textarea cols=15 rows=4>
Type your  text here (if any). Cols stands for columns.
 </textarea> 

Categories: Uncategorized | Leave a comment

Select element.

The select element allows you to create a drop down box. 

All you have to do is add this to your code!

<select>
<option> Option Name </option>
<option> Option Name 2 </option>
<option> Etc </option>
</select> 

Categories: Uncategorized | Leave a comment

Sample Program 3

<html>
<body bgcolor=”red” text=”white”>
<h1><center><u> TABLES </h1></u></center><br><br
<center>
<table border=”2″>
<tr>
<th>Header 1</th>
<th>Header 2</th>
</tr>
<tr>
<td>row 1, cell 1</td>
<td>row 1, cell 2</td>
</tr>
<tr>
<td>row 2, cell 1</td>
<td>row 2, cell 2</td>
</tr>
</table></center>
</body>
</html>

Categories: Uncategorized | Tags: , , | Leave a comment

Tables.

First, I’d like to thank everyone who has visited my blog. Why? Because I just crossed 275 hits. Thank you all so much!

Now lets get back.

Tables are defined with the <table> tag.

A table is divided into rows (with the <tr> tag), and each row is divided into data cells (with the <td> tag). td stands for “table data,” and holds the content of a data cell. A <td> tag can contain text, links, images, lists, forms, other tables, etc.

Below are a few common attributes.

<table> Defines a table
<th> Defines a table header
<tr> Defines a table row
<td> Defines a table cell
<caption> Defines a table caption
<thead> Defines a table’s header
Categories: Uncategorized | Tags: , , , | Leave a comment

Sample Program 2

<html>
<head>
<title> Input Tags </title>
</head>
<body bgcolor=”black” text=”white”>
<h1><center><u> LOGIN </u></h1></center><hr><br>
Name: <input type=”text” value=”” name=”UsrName”><br>
Password: <input type=”password” name=”UsrPass”><br>
<center> <input type=”submit” value=”Submit”> &nbsp; <input
type=”reset” value=”Reset”><hr>
</body>
</html>

&nbsp; leaves a space between two things (Try the program and you’ll understand).

My next post will be about tables and forms.

Categories: Uncategorized | Leave a comment

The input tag (IMPORTANT)

The input tag helps you input multiple things.
It’s syntax is <input type= “” value=”” name=””>
The name part of it will be used when you do Javascript.
The value attribute. I can explain with an example.
<input type=”button” value=”click me” name=”link”>
The type field can have the following values:

Value Description
button Defines a clickable button (mostly used with a JavaScript to activate a script)
checkbox Defines a checkbox
file Defines an input field and a “Browse…” button, for file uploads
hidden Defines a hidden input field
image Defines an image as a submit button
password Defines a password field. The characters in this field are masked
radio Defines a radio button
reset Defines a reset button. A reset button resets all form fields to their initial values
submit Defines a submit button. A submit button sends form data to a server
text Defines a one-line input field that a user can enter text into. Default width is 20 character
Categories: Uncategorized | Leave a comment

Lists. Ordered and Unordered.

Lists are of two types – Ordered and Unordered.

An ordered list is a pair of tags that have the syntax <ol> </ol>.

Each item in the list is denoted by <li> and </li>

<html>
<body>
<ol>
<li> Item 1 </li>
<li> Item 2 </li>
<li> Item 3 </li>
</ol>
</body>
</html>

Whereas, an unordered list has the syntax <ul> </ul>

Each list item is denoted by <li> and </li> as well

<html>
<body>
<ul>
<li> Item 1 </li>
<li> Item 2 </li>
<li> Item 3 </li>
</ul>
</body>
</html>

 

Categories: Uncategorized | Tags: , , , | Leave a comment

Blog at WordPress.com.

%d bloggers like this: