Soifwewanttoadd a labeltoreinputweneedtodoisweneedtousewhat's called a labelelement.
Solet's haveour 1st 1 beourusername.
Sowhat, you'regonnaputnamehere, andwecouldjustcopythisdownbecausewe'regoingtoneed a 2nd 1 whichisgoingtobefor a passwordsowecantypein a passwordhereandnowwe'realmostcompletewiththebasicsofreform.
Butweneedsomewaytosubmitourforms, sowe'regoingtocreate a buttontodothat.
Solet's justcreate a buttonhereandwe'regonnacallthissubmitforthetextofourbutton.
Inactuality, almostalwayswhenyoubuild a form, you'regoingtowantyourforeigntous a bitsomewhereotherthanthepageyou'recurrentlyon.
So I wantedtodothat.
Wehave a keywordhereinattributes, whichiscalledAction, andtheactionisgoingtobewhereyou'reforMisssubmittingtoandinourcasewe'rejustgoingtocreate a pagehere, whichiscalledresultsdothtml, andthisisgoingtobewhatwewantourformtosubmitto.
Thenextthingthatyoualmostalwaysair.
Gonnaspecifyon a formisthemethodyouwantyourformtouse, andthisiseithergoingtobegetorpostwouldgetrequest.
WhilethePostisgoingtobeusefulforwhenyouhave a serverwhereyouneedtosavesomeinformationif, forexample, wewoulduseposthere.
Soifwechangethistopostandwetrytosubmitsomethingyouseethatwereimmediatelygoingtogetanerabecausebrowserscan't renderpostrequest, theycanonlyrendergetrequestandwedon't have a server.
Sowhatweneedtodoisweneedtousegetrequesthereinsteadof a postrequest, andnowthisisgoingtoworkassoonaswecreateouractualpage.
Soif I typeinsomethinghereand I clickedtheenterkey, it's alsogoingtosubmitourform, whichiswhyhavingtypesofmintonyourbuttonisreallyusefulanditalsoallowsyoutohaveotherbuttonsinyourformthatdon't necessarilysubmityourform, becausethisonerighthereissubmittingit.
Sinceithasthetypeofsubmit, anothertypeofbuttonthat's reallyusefulandreallyundernooneisgoingtobe a buttonwith a typeofreset.
Justtoreiterate a littlebitonthepointsthatwetouchedon a placeholderisreallyusefulforwhenyouwanttogive a littlebitmoreinformationtoyouruserwhilevaluethatyouset.
So, forexample, wechangethisheretovalue.
Thisisreallyuseful.
Ifyoualreadyknowwhatthevalueisoryouwant a default.
Thisissomethingthatisgoingtobesubmittedwithyourformbecauseof a click.
Submit.
Itsubmitsthatusernamevalue.
Butifwechangeistobe a placeholder, forexample, insteadandweclicksubmit, itdoesnotsubmittheplaceholderonlythevalue.
Anotherthingyou'llnoticeisthatwe'reabletosubmit a blanknamein a blankpassword, whichin a loginform, youwouldwanttothrowsomekindoferrortotheuser, tellingthemtheycan't submitblankinformation.
Nowlet's moveonto a littlebitmorecomplicatedofField, whichisthenumberfield.
Soit's againenteranotherDevynherewiththelabel.
Thisisgoingtobeforwhatwe'regoingtoput a czaragebecausewewanttoasktheuserfortheirageandwe'regoingtocreateinputagainfordoingthat, andthisisgoingtohave a typehereofnumberandwhat's makesurereset a name, whichisgoingtosayageandan I D, whichisgoingtobe a JJ.