Working with Forms

Full Transcript

it's

welcome back to our class area in this video we're going to to use HTML forms we will allow our users to submit information to a web up through the usage off forms up to this point our users have just seen information and we were just plain to them from now on we want to get information from them using HTML forms HTML performs artist time there every time you are using for example this search walks in Google com you're using

%HESITATION HTML form

for this video we're going to use our thirteenth Montiel simple forms and mission

if you check the code closely what you will see he's there interaction of HTTP methods where using their post and the get HTTP method

if you remember from our age to be parts we were saying that whenever you were some meeting our request decline was meeting a request of it obligation it could use different type of age to be methods or purpose

in this case we are responding to two different methods either get or post and those are being handled by this name plus views

why is this basically when we disclaimed form we will be the client will be

ensuring I get requests whenever I boxes dis page I am sending I'd get request to get these particular reason

we're going to eat dead defied that gets request how what we're going to do is to serve the particular form we wanna show in this case this form to ida on you book

when we feel the formation of these form for example

I must admit it we will be in shame opposed request to the same resources so that's when we used to second branch of the sport

in our view the one handling that post request

if you check them closely they are releasing their arses they are rendering different types of samples

the first one day one dealing with the death request will respond with the template that passed actual form that we want to display

this form is included in the basic form dot HTML template

if you look closely and we can also inspect the HTML code from here you will see that each one of these text boxes are basically improved HTML tax as the one displayed here

I'm also displayed here

you can basically can walk through these inputs and you will start learning how HTML basically

works

when the user system means the datum we're going to get into these posts branch and we will render the

type of thing

but in this case we will harm or ready information available from the form so lets you made these example again

on what we're doing when we received the form is six truck to big data we are starting the title ISBN offer

from that particular form as you can see here the title as we end the author I. we're also extracting other type

formations for example were included keyed in type of input that has the name of Socrates

with the volume remoter I we're basically just talking the same one in there from this form that we're receiving

basically where she is putting all the data together are rendering that basic former sold that HTML template and that's what we're seeing right here the data that we sent our easy right here above and then we have to all other data that's basically day

secret hidden input unknowns of the value of this of me by

the only important thing to understand about forms is how the process works and that's why I wanna stress it one more time

basically you will have to handle two cases ones is when the user is requesting your market your farm so for example if you visit Google dot com move with such de basic information from their Google page and will serve just bear text input for you to submit your your partner

once you soon made your query that's a different type of reaction Google will not search the results and we'll give you

so usually when we work with forms and even if the forms in the same you will have to handle these two different hive

types of requests

finally it's important to note that the floss feature that allows these type of behavior differentiating the different types of %HESITATION HTTP verse or methods ease these methods key word that we passed to the route the greater

by default thoughts will allow shoes to get requests who paid and type a few that you create if you want to support different age should be methods post delete any other method you will have to

please simply put it in the methods he worked lost

mmhm