HTML Forms Tutorial PDF
Document Details
Uploaded by InstructiveNephrite4861
Universiti Utara Malaysia
Tags
Summary
This document covers a range of HTML form elements, including text boxes, password boxes and other interactive elements. It also describes how form data can be submitted to a web server. This document features topics suitable for a tutorial or lecture on HTML forms.
Full Transcript
C 2. INTRODUCTION TO HTML AND FORM (PART2) Client Side Script : HTML Form Objectives, at the end of this lecture, students will be able to: Create HTML document form Form Collect information from people viewing your site FORM element HTTP METHOD attribute ind...
C 2. INTRODUCTION TO HTML AND FORM (PART2) Client Side Script : HTML Form Objectives, at the end of this lecture, students will be able to: Create HTML document form Form Collect information from people viewing your site FORM element HTTP METHOD attribute indicates the way the Web server will organize and send the output METHOD = “post” submits data to be processed to a specified resource METHOD = “get” requests data from a specified resource ACTION attribute Path to a script (CGI / ASP/PHP/PY scripts) This script will process the data GET vs. POST GET POST Restrictions Yes, when sending data, the No restrictions on data GET method adds the data to length the URL; and the length of a URL is limited (maximum URL length is 2048 characters) Restrictions Only ASCII characters allowed No restrictions. Binary on data type data is also allowed Security GET is less secure compared to POST is a little safer than POST because data sent is part GET because the of the URL parameters are not Never use GET when sending stored in browser history passwords or other sensitive or in web server logs information! Visibility Data is visible to everyone in Data is not displayed in the URL the URL INPUT ELEMENTS Text Box Password Box Radio Buttons Check boxes Text Box A box in which anything can be typed ( e.g: letters, numbers) via the keyboard. Default size : 20 characters Markup: Linux UNIX SELECT Create a pop-up list from which any one option may be selected. Advantage: little screen space for list options. Markup: How are you reaching this page? U Mobile UNIFI Maxis CelcomDigi WIFI Multiple selections Select more than one : use attribute MULTIPLE Display many options : use attribute SIZE Markup: How are you reaching this page? U Mobile UNIFI Maxis CelcomDigi WIFI Text Area To create a box where the user may type large amounts of text Markup: Hidden INPUT Allows an input which is hidden from the user Programmers used this input for special programming purposes. Markup: SUBMIT & RESET TYPE = “submit” inserts a button that submits data to the server VALUE attribute changes the text displayed on the button (default is “Submit”) TYPE = “reset” inserts a button that clears all entries the user entered into the form VALUE attribute changes the text displayed on the button (default is “Reset”) SUBMIT & RESET Markup: