Download presentation
Presentation is loading. Please wait.
Published byClinton Chase Modified over 8 years ago
1
HTML and FORMS
2
A form is an area that can contain form elements. Form elements are elements that allow the user to enter information (like text fields, textarea fields, drop-down menus, radio buttons, checkboxes, etc.) in a form. A form is defined with the tag.. input elements.
3
The most used form tag is the tag. The type of input is specified with the type attribute. The most commonly used input types are explained below. The elements are: Text Box Text Area Radio box Check box Drop Downs Button
4
Text Fields Text fields are used when you want the user to type letters, numbers, etc. in a form. First name: Last name: First name: Last name:
5
Radio Buttons are used when you want the user to select one of a limited number of choices. Male Female Male Female
6
Checkboxes are used when you want the user to select one or more options of a limited number of choices. I have a bike: I have a car: I have an airplane: I have a bike: I have a car: I have an airplane:
7
Volvo Saab Fiat Audi Volvo Saab Fiat Audi Sample
8
The cat was playing in the garden. The cat was playing in the garden. Sample
9
Sample
10
Type your first name: Type your last name: If you click the "Submit" button, you will send your input to a new page called html_form_action.php. Type your first name: Type your last name: If you click the "Submit" button, you will send your input to a new page called html_form_action.php. Sample
11
Male: Female: If you click the "Submit" button, you will send your input to a new page called html_form_action.php. Male: Female: If you click the "Submit" button, you will send your input to a new page called html_form_action.php. Sample
12
message: ? Html_form.html Html_form_action.php
13
message: Html_form.html the button: waiting to be triggered
14
message: Html_form.html If the submit button is clicked, I will send the content of this textbox (named msg) to a destination page.
15
message: Html_form.html If the button is clicked, I will POST all of the contents of this form to this page.
16
message: ? Html_form.html Html_form_action.php
17
We need to CATCH the information… and PHP can help to that!
18
<?php $input = $_POST[‘msg’]; echo “You said: $input ”; ?>
19
message: <?php $input = $_POST[‘msg’]; echo “You said: $input ”; ?> Html_form.html Html_form_action.php
20
message: <?php $input = $_POST[‘msg’]; echo “You said: $input ”; ?> Html_form.html Html_form_action.php
21
You can add many input elements within the form tag, however, the NAME of the input element MUST be unique. In one html page, you can make many forms. Just be sure that the forms will not overlap from each other.
22
Be sure that the $_POST[whatever_the_name_of_the_form_element] i s consistent from the form source. Be sure that it is
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.