+ 1
Anyone can help me understand how forms are coded in html?
HTML question: forms
6 ответов
+ 6
html forms comprises 4 main components: form tag, label, input and a submit button. i.e
<form>
<label></label>
<input>
<button></button>
</form>
that's the basic skeleton of forms. But to make it really work as a form you need to add attributes and values to the tags. I will leave that to your exploration. Happy coding...
+ 4
You got the action method right.👍 But "GET" & "POST' are http headers. They tell the browser how to handle the form information sent over to server either locally or not.
+ 2
The method attribute tells how the browser handles the form information. Mostly two important values for the method attribute "GET" or "POST".
The action attribute points the url where the form is sent to be further processed. eg. action = "./formHandler.php", assuming the php file is in the same root location as the html file.
For a real or same production form, you can't achieve anything meaningful without using the method and action attributes.
+ 1
@benBright thanks for your answer, but let me rephrase my question: how are the method and action utilized ? I made a form with and without them and i had the same result so
+ 1
@benbright what do get and post mean? I mean what is their function ? and concerning action, it is not where the user is directed; it's where the collected data is sent when submitted, right ? (sorry for asking too much )
0
Thank you so much for your time ! much appreciated💕