10
HTML Form Inputs HTML Form Inputs

HTML Form Inputs. Creating a basic form …content goes here…

Embed Size (px)

DESCRIPTION

Controls  Text inputs  Check boxes  Radio buttons  Select menus  File selects  Buttons ( “submit”, “reset”, push) The majority of controls are created with “input” tag

Citation preview

Page 1: HTML Form Inputs. Creating a basic form  …content goes here…

HTML Form InputsHTML Form Inputs

Page 2: HTML Form Inputs. Creating a basic form  …content goes here…

Creating a basic formCreating a basic form

<form><form>……content goes here…content goes here…

</form></form>

Page 3: HTML Form Inputs. Creating a basic form  …content goes here…

ControlsControls

Text inputsText inputs Check boxesCheck boxes Radio buttonsRadio buttons Select menusSelect menus File selectsFile selects Buttons ( “submit”, “reset”, push)Buttons ( “submit”, “reset”, push)

The majority of controls are created with “input” tagThe majority of controls are created with “input” tag

Page 4: HTML Form Inputs. Creating a basic form  …content goes here…

Text inputText input

<form><form><input <input typetype=“text” />=“text” /></form></form>

Type tell us what kind of control is

Attribute of text input:

name

size

maxlength

value

Page 5: HTML Form Inputs. Creating a basic form  …content goes here…

Password:Password:<input type=“password” name=“Password” /><input type=“password” name=“Password” />

Textarea:Textarea:<textarea name=“Comments”></textarea><textarea name=“Comments”></textarea>

attributes: cols, rows, wrapattributes: cols, rows, wrap

Page 6: HTML Form Inputs. Creating a basic form  …content goes here…

Radio buttonsRadio buttonsInput tag and “radio” in type attributeInput tag and “radio” in type attribute

Check buttonsCheck buttonsInput tag and “checkbox” in type attributeInput tag and “checkbox” in type attribute

Page 7: HTML Form Inputs. Creating a basic form  …content goes here…

Select Menus Select Menus also called ”drop-down menus”also called ”drop-down menus”

<select name=“Somename” <select name=“Somename” sizesize=“3”=“3”<option value=“value1”>value1</option><option value=“value1”>value1</option><option value=“value2”>value2</option><option value=“value2”>value2</option><option value=“value3”>value3</option><option value=“value3”>value3</option><option value=“value4”>value4</option><option value=“value4”>value4</option><option value=“value5”>value5</option><option value=“value5”>value5</option>

</select ></select >

how many visible at once

Page 8: HTML Form Inputs. Creating a basic form  …content goes here…

SubmenusSubmenus<select name=“TimeDay”><select name=“TimeDay”><optgroup label=“Monday”><optgroup label=“Monday”>

<option value=“Monday AM”>Monday morning</option><option value=“Monday AM”>Monday morning</option><option value=“Monday PM”>Monday afternoon</option><option value=“Monday PM”>Monday afternoon</option>

</optgroup></optgroup><optgroup label=“Tuesday”><optgroup label=“Tuesday”>

<option value=“Tuesday AM”>Tuesday morning</option><option value=“Tuesday AM”>Tuesday morning</option><option value=“Tuesday PM”>Tuesday afternoon</option><option value=“Tuesday PM”>Tuesday afternoon</option>

</optgroup></optgroup></select></select>

Page 9: HTML Form Inputs. Creating a basic form  …content goes here…

File uploadsFile uploads

<form><form><input type=“file” name=“PhotoUpload” /><input type=“file” name=“PhotoUpload” />

</form></form>

Page 10: HTML Form Inputs. Creating a basic form  …content goes here…

ButtonsButtons SubmitSubmit

- when pressed, this button processes the form- when pressed, this button processes the formtype=“submit”type=“submit”

ResetReset- when pressed, this button resets all the form’s fields back to their - when pressed, this button resets all the form’s fields back to their initial valuesinitial values

type=“reset”type=“reset” (Push) Buttons(Push) Buttons

- when pressed, an action or event is triggered, based on a - when pressed, an action or event is triggered, based on a predefined script or functionpredefined script or function

type=“button”type=“button”