<!DOCTYPE HTML><HTML><Head><MetaCharSet= "UTF-8"><title>Form elements</title></Head><Body> <!--forms are the means by which data is transferred from the browser to the server the form has two elements:-form TABLE Element-form control forms are primarily used to display, collect, and submit information to the server - <formAction=""Method= "POST"> <!---action: Form submission Url-method: How form data is submitted-entype: How form data is encoded - <!--form controls: text box, Password box radio box, check box button hide field, File selection box-Other: Label, text field, drop-down box, etc. - <H1>Form</H1> <!--INPUT element as text box and password box - <!--Common Properties: Value property: The text content of the corresponding input box or password box maxlength: Limit the number of characters entered ReadOnly: Set text read-only - <P> <label for= "Name">User name:</label> <inputtype= "text"ID= "Name"name= "User"value= "< Please enter your user name >"/> </P> <!--Label label element, which is used to set the name of the control for: sets the control ID associated with the text, and then clicks the tag equals the click Control - <P> <label for= "Pass">Password:</label> <inputtype= "Password"ID= "Pass"name= "Pass"maxlength= "8"> </P> <!--INPUT element as a radio box and check box - <P>Gender: <label for= "M">Man:</label> <inputtype= "Radio"name= "Sex"ID= "M"value= "M"> <label for= "F">Woman:</label> <inputtype= "Radio"name= "Sex"ID= "F"checked= "Checked"value= "F"> <!--Common Properties: Name property: Used to implement grouping, a set of radio boxes or check boxes must have the same names. Cheched Property: Sets the selected Value property: Text, when the page submits the form, the corresponding value value is sent to the server - </P> <P>Hobbies:<BR> <inputtype= "checkbox"name= "Hobby"value= "1">Play Basketball <inputtype= "checkbox"name= "Hobby"value= "2">Play football<BR> <inputtype= "checkbox"name= "Hobby"value= "3">Play Table Tennis <inputtype= "checkbox"name= "Hobby"value= "4">Ski<BR> <inputtype= "checkbox"name= "Hobby"value= "5">Climbing <inputtype= "checkbox"name= "Hobby"value= "6">Boxing<BR> </P> <!--INPUT Element as button Submit button: Submit-Transfer form data to server or other program processing reset button: Reset--Empty the form inside Restore all form controls to their default state and default values normal Anqiu: button--For executing client script properties: Value: Name of the button - <P> <inputtype= "Submit"value= "Save"> <inputtype= "Reset"value= "Reset"> <inputtype= "button"value= "Cancel"> </P> <!--Hide fields and file marquee hide fields hidden--Include information files that you do not want users to see in the form file--upload file to server - <inputtype= "hidden"name= "User character"value= "SB"> <inputtype= "File"><BR> <!--text fields are equivalent to multiple lines of text boxes <textarea> elements main properties: Col S: Specifies the number of columns for the text area rows: Specifies the number of lines in the range ReadOnly: Read-only - <P>Text area:<BR> <textarearows= "Ten"cols= "Ten">Guangzhou Tianhe District Tianhe Road building West Room No. No. 2407</textarea> </P> <!--Drop-down menu - <P>Course:<BR> <Selectname= "Course"> <optionvalue= "1">Java</option> <optionvalue= "2">Php</option> <optionvalue= "3">. NET</option> </Select> </P> </form></Body></HTML>
html-form Controls