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.
Theonesothatmeanswhenweclickareupanddown a Rockies.
It's goingtoincreaseanddecreasebyone.
Butforexample, wecouldchangeus.
Whatifwewantedtotobebyfive.
Soifwesaythisnow, when I clickup, it's goingtoincreasebyfiveat a time.
Asyoucansee, thenextinputelementwewanttocoverisgoingtobethedateandputelement, andagain, thisisgoingtobejustlikeallofourotheremployeeselementswe'regoingtohave a labelwhichwe'regoingtoset a fourto.
Inourcase, we'regonnasayfordateandwe'rejustgonnacomeinhereandwe'regonnasaythisisgoingtobe a birthday, forexample.
Sonowlet's godownhere.
We'regonnacreateaninputandisgoingtohave a type, andwejustwanttosetthistodatetospecifyit's a date.
Gonnamakesurehesaidthenametodatethe i d twodatesthatwematchourfourforourlabeloverhere, andwe'rejustgonnaclosethatoff.
Andnowifwesaveyousaidthatweget a dateinput, whichalreadyhassomedefaultsforceaswellas a nicelittledatepicker.
Wecanselectwhatdatewewantinsideofhere, justlikewiththenumberfieldweaken, forexample, specify a minimumand a maximumofthreewant.
Solet's comeinhere, specifyminimum, whichisthere's goingtobe 2019 June 10thwouldsavethatandcomeinhere.
Andif I trytoselectthedatebeforethat, itwon't letme.
Butitallowedmetoselectthedayafterthat.
Andif I comeinhereandmanuallychangethis, forexample, I wanttochangeittothefirst.
Butwhatifweonlywanttobeabletoallow a usercheckoneboxat a timeinsteadofalloftheboxescausewithcheckboxes, youcancheckasmanyoraslittleoftheboxesasyouwant.
Butifyouwanttoallowthemonlytospecifyonefavoritefood, weneedtousewhat's called a radiobutton.
Downhere, yousee, theyhavetheexactsamename, whichmeansthatwecouldonlyselectoneofthemat a singletime, asopposedtobeoslikemultiple.
Onethingthatyouneedtodoadditionallywithradiobuttons, though, isactuallyspecify a valuesoWhenyousubmitittoyourform, youknowwhatyou'regettingback.
Soinourcase, wewanttoput a valuehere, whichisgoingtobemale.
Andfor a femalewhowanttoput a value, whichisgoingtobefemalenow, I'vesavedthatandactuallyenterinstantinformationfor a formsothatwehavesomevalidinformation.
Andlet's selectmailandweclicksubmitandyou'llseewegetgenderheresettomail, whichcorrespondswiththevaluethatweselectedherefor a radiobutton.
Andnowwehavebothofourvaluesselected, andifwefillineverythingelseonourformjustsowecanseewhatthislookslikeandmakesourpasswordsthatandwesubmit, youseethathaseyecolorshowinguptwice a bullforgreenandforredbecauseweselectedbothofthosevaluesfromourpreviousform.
Andthisoneiscalled a textarea, andthisagainisnotactuallyfromaninput.
It's itsownelementcalledtextArea, andthisisoneofthefewelementsthathasanactualclosingtagbecausethevalueactuallygoesinsideofthetextareahere, asopposedtoon a valueattribute.
Sonowit's firstbeforewegetcarriedaway, put a labelwhichisgoingtohavefourhere, andthisisgoingtobe a filefor a user.
Wecouldjustsaybioandagain, wewanttomakesurewehavean I D onhere, whichisgoingtomatchthefourfromourlabeland a namesowecanactuallyusethisinsteadofourformandnottoput a bioinsideofhere.
Sowe'regonnasaymynameisKyle, andifwesaythat, youseethatwehave a bunchofextraspacebeingaddedintoourelementhere, andthat's becausethistextareaconvertsallofthewhitespace.
Thetypehereisgoingtobe a filetype, andagain, we'rejustgoingtogiveit a nameoffilessowecanknowwhatit's actuallylookingforwhenwesubmitourform.
Andnowyoucanseedownherewecanactuallychoose a filetosubmittoourbrowser, butthefirstthingweneedtodotomakeitsothatwhenwesubmitthisto a serverthatit's actuallyusefulforourserver.
Weneedtospecify a newattributesonourformhere, andthisisgoingtobecalledthe E N C type, justlikethisandinsidetohearwhatwewantismultipartformedatitonwhatthisessentiallysays, hisfilesareverylarge.
Andinsideofthisdidwewanttomakesurewehaveourlabelandthisisgoingtobefor a phone.
We'regonnaaskouruserfortheirphonenumbersowe'llsayfor a phonegonnasayphoneisthelabelandwejustwantinput.
Andtheactualtypeofthisisgoingtobetell T e l justlikethisstandsfortelephonename.
Hereisgoingtobephonebooks.
Phonecannottypetwodaysinbed, phoneandan I D.
Whichisgoingtomatchourfourofphone.
Closethatoff.
Andtherewehaveourphonefieldon.
Thereallygreatthingaboutthisphonefieldisthatif a user's on a phoneenteringthisinformation, it'llgivethem a nicekeypad, whichisspecificallymeantforenteringphonenumbersandnotjustforenteringgenerictext.
Solet's create a divcriedourlabelforit, whichisjustgoingtosayfor a girl, closethesoftgirlandwewanttomakesurewehaveourinput, whichisgoingtohave a typehereofeuro, a nameofeuro, andit's goingtohavean I d ofyourown.
Closethatoff.
Therewegoandyoucanseewegetouryour l enteringdownhereandanothergreatthingaboutthisagainonmobilephones.
It's goingtogivethem a specialkeepedthatspecificallymeantforenteringyouareelse.
Lastly, I wanttocoverjustthekindoffuninputelementhere, whichyouprobablywon't everseeanywhere.
Butit's justfuntouse.
Everyoncein a whilethiswasgoingtobeforcolor.
Sowe'regoingtosayhereforcolor, makesureitsayscolorhereandagain, asyouguessed, itisgoingtobeaninput, whichisgoingtohave a typeofcolorlipstypecolorunnamed, whichisgoingtobecolor.
Andit's goingtohavean i D.
Whichiscolor.
Closethisoffandnowyousee, herewehave a colorselector.