HTML Forms Review

hi,

i was doing the davies burger lesson, and at the end it said to make a submit button. I was wondering if there is a way u get the information inputted? like forexample you own a real returant, and someone is ordering something, and u want to know! so how can i do that?

website

https://www.codecademy.com/courses/learn-html/lessons/html-forms/exercises/form-review

You’d probably send the information to a server and have the server deal with that information somehow.

I think that can be done using the <form> tag with some of these attributes:

  • action
  • enctype
  • method

or, instead of using the <form> tag, you could use <input> (with type="submit"), [which ends up looking like a button] with some of these attributes:

  • formaction
  • formenctype
  • formmethod

Alternatively, you could use JavaScript to process or display the information or send the information somewhere.

Hi, thanks for the reply.

I know how to use the <form> and <input>. Like you said send it somewhere, but how do I send it?

Form data is sent (or ‘submitted’) when the <input> with type="submit" is clicked. The data is sent to the URL specified in the <form> tag, which goes in as the action:

image

This will “POST” the data to the submission.html page. To POST it means to send it, expecting nothing in return (from the recipient).

1 Like

How can I recieve that data when they submit?

We’re getting a bit off-topic now, since this is an HTML-only course, but you can find out more about retrieving the data here.