What is the difference between form action and form id

Hi how are you? I hope you are well, I am cofused and I can’t find information about it, what is the difference between:

<***form action***="/url-where-you-want-to-submit-form-data">
<label for="name"> Name </label>
  <input>
</form>
...

or
<form id="/url-where-you-want-to-submit-form-data">
Name

...

In the Challenge: Build a Survey Form appears User Story #3: I can see a form with id="survey-form" . but I see that in the course appears
“form action” and not “form id”.

I know id: is a unique identifier (it should always be) for any html tag.maybe it is a stupid question. However, I would like be sure about understand all these topics since the beginning. I am a completely beginner

I will be grateful with your answer, thank you in advance

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.164 Safari/537.36

Link to the challenge:

The form id is a unique identifier, applying to only this one form.
The form-action is what happens with the information a user would enter into the form, once the form is submitted.

The id is just a name for the form, it has no value outside of being a name - but has to be unique.
The form action however does pretty much what is written there: it’s the url of where you want to send the data. This is the entire reason you have the form in the first place: to actually do something with the data, by sending it to another application.

1 Like

I don’t remember if the id is shown on the form or not, but the id is not an attribute specific to form elements, it can go on any element. action is specific to form elements and has that specific function

you can have a form with both an id and an action attribute

2 Likes

Thank you very much! :heart_eyes: :sparkling_heart: I could understand it thanks to you

Thank you very much! :heart_eyes: :sparkling_heart: Now I understand it, thank you Ilenia