Skip to content

Latest commit

 

History

History
37 lines (37 loc) · 1.69 KB

read9.md

File metadata and controls

37 lines (37 loc) · 1.69 KB

Forms, Lists, Tables and Events

Form

A form is an input feature. It used to let the user inserting data. The form process is:

  1. user fill the data in the form
  2. the name of the control and the value are sent to the server
  3. the server process the information
  4. the server takes an action after the process as creating a new page and send it back to the user

type of forms:

  • text input
  • password input
  • text area
  • submit button
  • check box
  • drop down list box
  • multiple select box

Form validation are performed in JavaScript or HTML5. It insures the filled data match the form expecting data type. Some of the HTML5 form validation attributes:

  • date input
  • email and url input
  • search input

Lists, Tables and Forms

for lists, there are two types of lists

  • ordered lists
  • unordered lists

style for lists include the side sign or number before the list content. It can be styled and positioned.

Tables can be styled too. The table border, margin, padding, width, text-align and hover are some of these properties.

forms are also can be styled like:

  • adding color to the submit button
  • adding border to the field sets and legends

Events

Event handling is done using three steps:

  1. select the element node to be responded
  2. indicate which event on the selected node will trigger the response
  3. put the code the will be run when the event is triggered

there are three ways to bind event to element:

  • HTML event handlers
  • traditional DOM event handlers
  • DOM level 2 event listeners