- The form is the box that can be in the website that collect data or using it to search or registering as a member of a website
- Adding text
- Text input Used for a single line of text such as email addresses and names
- Password input Like a single line text box but it masks the characters entered
- Text area (multi-line) For longer areas of text, such as messages and comments
- Making Choices
- Radio buttons For use when a user must select one of a number of options
- Checkboxes When a user can select and unselect one or more options
- Drop-down boxes When a user must pick one of a number of options from a list
- Submitting Forms
- Submit buttons To submit data from your form to another web page
- Image buttons Similar to submit buttons but they allow you to use an image
- Uploading Files
- File upload Allows users to upload files to a website
Forms work when user fills in a form and then presses a button to submit the information to the server
-
we Structure the form using the
<form>element -
Every
<form>element requires an<action>attribute -
Forms can be sent using one of two methods
get orpost -
HTML5 introduces new form elements which make it easier for visitors to fill in forms
-
The
list-style-typeproperty allows to control the shape or style of a bullet point it can be used to rules that apply to the<ol><ul>and<li>elements like decimal or lower-alpha for Ordered Lists and disc or square for Unordered Lists -
we can specify an image to act as a bullet point using the
list-style-imageproperty -
the
list-stylepositions property can take one of two values to y indicates whether the marker should appear on the inside or the outside -
table properties
widthto set the width of the tablepaddingto set the space between the border of each table cell and its contenttext-transformto convert the content of the table headers to uppercaseletter-spacingfont-size to add additional styling to the content of the table headersborder-top,border-bottomto set borders above and below the table headerstext-alignto align the writing to the left of some table cells and to the right of the othersbackground-colorto change the background color of the alternating table rows:hoverto highlight a table row when a user's mouse goes over it
-
Forms are easier to use if the form controls are vertically aligned using CSS
-
Forms benefit from styles that make them feel more interactive
EVENTS happend when a user interacts with the browse to trigger a function the code
- When the user interacts with the HTML on a web page, there are three steps to trigger some JavaScript code :
- Select t he element node you want the script to respond to
- Indicate which event on the selected node(s) will trigger the response
- State the code you want to run when the event occurs
Event Summry
-
Events are the browser's way of indicating when something has happened
-
Binding is the process of stating which event you are waiting to happen, and which element you are waiting for that event to happen upon
-
When an event occurs on an element, it can trigger a JavaScript function.
-
You can use event delegation to monitor for events that happen on all of the children of an element
-
The most commonly used events are W3C DOM events