Docsity

Chapter no.7:- <form>tag HTML <form> Tag :-, Lecture notes of Web Programming and Technologies

Toggle sidebar
bg1
Chapter no.7:- <form>tag
HTML <form> Tag :-
The <form> tag is used to add HTML forms to the web page for user input. Forms are used to
pass the data submitted by the user to the server. The data is sent when pressing the "Submit"
button. If there isn’t such button, the information is sent when the "Enter" key is pressed.
Syntax
The <form> tag comes in pairs. The content is written between the opening (<form>) and closing
(</form>) tags.
The <form> element contains other HTML tags, which define the input method of data:
The <input> tag defines a user input field.
The <textarea> tag defines a form field to create a multiline input area.
The <button> tag is used to place a button inside a form.
The <select> tag sets up a control for creating a drop-down list box.
The <option> tag defines the items in the drop-down list set by the <select> tag.
The <optgroup> tag groups related data in the drop-down list set by the <select> tag.
The <fieldset> tag visually groups the elements inside the form set by the <form> tag.
The <label> tag sets the text label for the <input> element.
The <legend> tag defines the header for the <fieldset> element.
Example of <form>tag:-
<html>
<head>
<title>Title of the document</title>
</head>
<body>
<form action="server-script-url-here" method="GET or POST" >
<label for="fname">Name</label>
<input type="text" name="FirstName" id="fname" value="Mary"/><br/><br/>
<label for="lname">Surname</label>
<input type="text" name="LastName"id="lname"
value="Thomson"/><br/><br/>
<input type="submit" value="Submit"/>
</form>
</body>
</html>
Example of the HTML <form> tag with the <texarea> tag:
<html>
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff

Partial preview of the text

Download Chapter no.7:-
tag HTML Tag :- and more Lecture notes Web Programming and Technologies in PDF only on Docsity!

Chapter no.7:- tag

HTML Tag :-

The tag is used to add HTML forms to the web page for user input. Forms are used to pass the data submitted by the user to the server. The data is sent when pressing the "Submit" button. If there isn’t such button, the information is sent when the "Enter" key is pressed. Syntax The tag comes in pairs. The content is written between the opening () and closing () tags. The element contains other HTML tags, which define the input method of data:  The tag defines a user input field.  The tag is used to place a button inside a form.  The tag sets up a control for creating a drop-down list box.  The tag.  The tag groups related data in the drop-down list set by the tag.  The tag visually groups the elements inside the form set by the tag.  The tag sets the text label for the element.  The tag defines the header for the element. Example of tag:-

Title of the document

Name

Surname

Example of the HTML tag with the tag:

Title of the document

Form example


HTML Input Types

Here are the different input types you can use in HTML:

                      Syntax input type:-

  1. defines a single-line text input field 2) defines a password field
  2. defines a button for submitting form data to a form-handler.

Note that the form itself is not visible.

Also note that the default width of a text field is 20 characters.

Output:-

Text field

The input type="text" defines a one-line text input field: First name: Last name: Note that the form itself is not visible. Also note that the default width of a text field is 20 characters.

Chapter no.8:- DHTML And DOM And CSS DHTML:- DHTML stands for Dynamic HTML, it is totally different from HTML. ... The DHTML is based on the properties of the HTML, javascript, CSS, and DOM (Document Object Model which is used to access individual elements of a document) which helps in making dynamic content. It is the combination of HTML, CSS, JS, and DOM.

DHTML - HTML Document Object Model (DOM)

The DOM presents HTML as a tree-structure (a node tree), with elements, attributes, and text: The HTML DOM is:  A standard object model for HTML  A standard programming interface for HTML  Platform- and language-independent

These paragraphs are styled with CSS.

OUTPUT :- Hello World! These paragraphs are styled with CSS.


Example Explained  p is a selector in CSS (it points to the HTML element you want to style:

).  color is a property, and red is the property value  text-align is a property, and center is the property value

**CHAPTER 9:- JAVASCRIPT N VBSCRIPT:-**

What is JavaScript :-

JavaScript is a dynamic computer programming language. It is lightweight and most commonly used as a part of web pages, whose implementations allow client-side script to interact with the user and make dynamic pages. It is an interpreted programming language with object-oriented capabilities. JavaScript was first known as LiveScript, but Netscape changed its name to JavaScript, possibly because of the excitement being generated by Java. JavaScript made its first appearance in Netscape 2.0 in 1995 with the name LiveScript. The general-purpose core of the language has been embedded in Netscape, Internet Explorer, and other web browsers. JavaScript is the programming language of HTML and the Web. JavaScript is easy to learn. This tutorial will teach you JavaScript from basic to advanced.

Advantages of JavaScript:-

  1. Less server interaction − You can validate user input before sending the page off to the server. This saves server traffic, which means less load on your server.
  2. Immediate feedback to the visitors − They don't have to wait for a page reload to see if they have forgotten to enter something.
  3. Increased interactivity − You can create interfaces that react when the user hovers over them with a mouse or activates them via the keyboard.

Limitations of JavaScript:-

  1. Client-side JavaScript does not allow the reading or writing of files. This has been kept for security reason.
  2. JavaScript cannot be used for networking applications because there is no such support available.
  3. JavaScript doesn't have any multi-threading or multiprocessor capabilities. SIMPLE EXAMPLE OF JAVA SCRIPT:-

My First JavaScript

**document.getElementById("demo").innerHTML = x;

**

OUTPUT:-

JavaScript Variables

In this example, x is defined as a variable. Then, x is assigned the value of 6: 6

JavaScript Operators:-

1) Arithmetic Operators

2) Assignment Operators

3) String Operators

4) Comparison Operators

5) Logical Operators

6)Type Operators

  1. Bitwise Operators OPERATORS Description ARITHMETIC
  • Addition
  • Subtraction
  • Multiplication % Modulus ** Exponentiation ++ Increment -- Decrement / Division

OPERATORS Description Assignment

= X=y X=y += X+=y X=X+y

  • = x-=y X=x-y = X=y X=Xy /= x/=y X=x/y %= X%=y X=X%y = X=y X=X*y

OPERATORS Description Comparison

== equal to == equal to === equal value and equal type === equal value and equal type != not equal != not equal !== not equal value or not equal type !== not equal value or not equal type > greater than > greater than < less than < less than >= greater than or equal to >= greater than or equal to <= less than or equal to <= less than or equal to ? ternary operator? ternary operator

OPERATORS Description Logical

&& logical and && logical and || logical or || logical or ! logical not! logical not

OPERATORS Description Type Operators

typeof Returns the type of a variable instanceof Returns true if an object is an instance of an object type

Bitwise Operator:-

Operator Description Example Same as Result Decimal & AND 5 & 1 0101 & 0001 0001 1 | Or 5 | 1 0101 & 0001 0101 5 ~ Not ~ 5 0101 | 0001 1010 10 ^ Xor 5 ^ 1 ~0101 0100 4 << Zero fill left shift 5 << 1 0101 ^ 0001 1010 10 >> Signed right shift 5 >> 1 0101 << 1 0010 2 >>> Zero fill right shift 5 >> 1 0101 >> 1 0010 2

document.getElementById("demo").innerHTML = text;

Output:-

JavaScript For Loop

The number is 0

The number is 1

The number is 2

The number is 3

The number is 4

VB script:-

VB Script stands for V isual B asic Scripting that forms a subset of Visual Basic for Applications (VBA). VBA is a product of Microsoft which is included NOT only in other Microsoft products such as MS Project and MS Office but also in Third Party tools such as AUTO CAD.

Features of VBScript

 VBScript is a lightweight scripting language, which has a lightning fast interpreter.  VBScript, for the most part, is case insensitive. It has a very simple syntax, easy to learn and to implement.  Unlike C++ or Java, VBScript is an object-based scripting language and NOT an Object- Oriented Programming language.  It uses Component Object Model (COM) in order to access the elements of the environment in which it is executing.  Successful execution of VBScript can happen only if it is executed in Host Environment such as Internet Explorer (IE) , Internet Information Services (IIS) and Windows Scripting Host (WSH) Let us write a VBScript to print out "Hello World". In the below example, we called a function document.write , which writes a string into the HTML document. This function can be used to write text, HTML or bothSo, above code will display following result –

VBScript Variables A variable is a named memory location used to hold a value that can be changed during the script execution. VBScript has only ONE fundamental data type, Variant. Rules for Declaring Variables −  Variable Name must begin with an alphabet.  Variable names cannot exceed 255 characters.  Variables Should NOT contain a period (.)  Variable Names should be unique in the declared context.

Declaring Variables:-

Variables are declared using “dim” keyword. Since there is only ONE fundamental data type, all the declared variables are variant by default. Hence, a user NEED NOT mention the type of data during declaration. Example 1 − In this Example, IntValue can be used as a String, Integer or even arrays. Dim var Example 2 − Two or more declarations are separated by comma(,) Dim Variable1,variable

Scope of the Variables

Variables can be declared using the following statements that determines the scope of the variable. The scope of the variable plays a crucial role when used within a procedure or classes.  Dim  Public  Private

Chapter10:-

Intoduction to ASP and ASP Script:-

Asp stands for Active server pages. ASP is program that runs inside IIS IIS stands for Internet Information Services ASP is Microsoft solution to building advanced web sites Active Server Pages were introduced by Microsoft in 1996 as a downloadable feature of Internet Information Server 3.0. The concept is pretty simple: an Active Server Page allows code written in the JavaScript or VBScript languages to be embedded within the HTML tags of a Web page and executed on the Web server. There are great advantages to this, not the least of which is security. Since your code is executed on the Web server, only HTML tags are sent to the browser. The result is that the ASP code is “invisible” to the end user. Another upside to the “server-side script” concept is that it allows things like database connections to be made from the Web server rather than from the client. Therefore, any special configurations that might need to be set up, like ODBC data sources, only have to exist on the server. Of course, before you can create an Active Server Page (ASP), you’ll need to look at the software requirements. ASP and ASP.NET are server side technologies. Both technologies enable computer code to be executed by an Internet server. When a browser requests an ASP or ASP.NET file, the ASP engine reads the file, executes any code in the file, and returns the result to the browser. Classic ASP - Active Server Pages ASP (aka Classic ASP) was introduced in 1998 as Microsoft's first server side scripting language. Classic ASP pages have the file extension .asp and are normally written in VBScript.

Installation of IIS:-

  1. Click the Start icon.
  2. Click Control Panel.
  3. Select Programs and Features.
  4. Select. ...
  5. In the Windows Features dialog box, expand World Wide Web Services. ...
  6. Under Application and Development Features, select ASP.NET. ...
  1. Under Security, select Basic Authentication. ...
  2. Click OK to begin the installation.