Why should we still use form element in html? [closed]
Clash Royale CLAN TAG#URR8PPP
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
With modern javascript (and js framework too!) and different ways to do a sync/async actions (POST, GET etc,..) I am still wondering why would one still want to use form element?
Is it due to code semantics and actually "specifying" an area from which something is submitted?
Is it because form acts as a helper that "collects" (poorly I would say) data?
All of the above can be easily done in javascript, so I cannot think of any other reason for using form for submitting data?
javascript html forms
closed as primarily opinion-based by ellipsis, R3tep, Clyde Lobo, James Coyle, Jared Smith Mar 7 at 13:45
Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise. If this question can be reworded to fit the rules in the help center, please edit the question.
add a comment |
With modern javascript (and js framework too!) and different ways to do a sync/async actions (POST, GET etc,..) I am still wondering why would one still want to use form element?
Is it due to code semantics and actually "specifying" an area from which something is submitted?
Is it because form acts as a helper that "collects" (poorly I would say) data?
All of the above can be easily done in javascript, so I cannot think of any other reason for using form for submitting data?
javascript html forms
closed as primarily opinion-based by ellipsis, R3tep, Clyde Lobo, James Coyle, Jared Smith Mar 7 at 13:45
Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise. If this question can be reworded to fit the rules in the help center, please edit the question.
7
For accessibility
– R3tep
Mar 7 at 9:47
1
Main use case of form element and for that many element is providing information about your html file to whoever is reading and to search engines.
– binariedMe
Mar 7 at 9:47
1
Maybe rephrase it like "what are the advantages of usingform
tags" instead of "why should we still use"? Then it's less option-based. The question is very interesting.
– Gherman
Mar 7 at 13:55
add a comment |
With modern javascript (and js framework too!) and different ways to do a sync/async actions (POST, GET etc,..) I am still wondering why would one still want to use form element?
Is it due to code semantics and actually "specifying" an area from which something is submitted?
Is it because form acts as a helper that "collects" (poorly I would say) data?
All of the above can be easily done in javascript, so I cannot think of any other reason for using form for submitting data?
javascript html forms
With modern javascript (and js framework too!) and different ways to do a sync/async actions (POST, GET etc,..) I am still wondering why would one still want to use form element?
Is it due to code semantics and actually "specifying" an area from which something is submitted?
Is it because form acts as a helper that "collects" (poorly I would say) data?
All of the above can be easily done in javascript, so I cannot think of any other reason for using form for submitting data?
javascript html forms
javascript html forms
asked Mar 7 at 9:43
mkomko
1,59353255
1,59353255
closed as primarily opinion-based by ellipsis, R3tep, Clyde Lobo, James Coyle, Jared Smith Mar 7 at 13:45
Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise. If this question can be reworded to fit the rules in the help center, please edit the question.
closed as primarily opinion-based by ellipsis, R3tep, Clyde Lobo, James Coyle, Jared Smith Mar 7 at 13:45
Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise. If this question can be reworded to fit the rules in the help center, please edit the question.
7
For accessibility
– R3tep
Mar 7 at 9:47
1
Main use case of form element and for that many element is providing information about your html file to whoever is reading and to search engines.
– binariedMe
Mar 7 at 9:47
1
Maybe rephrase it like "what are the advantages of usingform
tags" instead of "why should we still use"? Then it's less option-based. The question is very interesting.
– Gherman
Mar 7 at 13:55
add a comment |
7
For accessibility
– R3tep
Mar 7 at 9:47
1
Main use case of form element and for that many element is providing information about your html file to whoever is reading and to search engines.
– binariedMe
Mar 7 at 9:47
1
Maybe rephrase it like "what are the advantages of usingform
tags" instead of "why should we still use"? Then it's less option-based. The question is very interesting.
– Gherman
Mar 7 at 13:55
7
7
For accessibility
– R3tep
Mar 7 at 9:47
For accessibility
– R3tep
Mar 7 at 9:47
1
1
Main use case of form element and for that many element is providing information about your html file to whoever is reading and to search engines.
– binariedMe
Mar 7 at 9:47
Main use case of form element and for that many element is providing information about your html file to whoever is reading and to search engines.
– binariedMe
Mar 7 at 9:47
1
1
Maybe rephrase it like "what are the advantages of using
form
tags" instead of "why should we still use"? Then it's less option-based. The question is very interesting.– Gherman
Mar 7 at 13:55
Maybe rephrase it like "what are the advantages of using
form
tags" instead of "why should we still use"? Then it's less option-based. The question is very interesting.– Gherman
Mar 7 at 13:55
add a comment |
3 Answers
3
active
oldest
votes
Writing unobtrusive JavaScript that works using progressive enhacement continues to be best practise because there are plenty of circumstances where JavaScript fails.
Aside from that, just because you can do something with JavaScript doesn't mean you should do something with JavaScript. Often a regular form submission will give all the desired effects with less work.
And on top of that, a form is a useful element to collect data with even if you do use JavaScript. For example, you can use a form element to populate a FormData
element.
Forms provide semantic data to group form controls, this is heavily used by screen readers.
As mentioned in comments, some password managers use them to identify grouped login form controls.
4
Adding a specific example to why preserving standard semantics is required: Chrome's user/password/credentials autofill only works if the inputs are inside aform
element that is submitted. It won't save anything otherwise.
– Sergiu Paraschiv
Mar 7 at 9:51
Weather unobtrusive JavaScript continues to be best practice is questionable. There are a ton of web-apps that either do not support it or even cannot support it. There too few no-js users their support is very costly.
– Gherman
Mar 7 at 13:52
add a comment |
one reason is if, for any reason, javascript is disabled / not allowed but an application still should work.
1
just with pure html... <form action="datatransfer.php" method="multipart/form-data"> is pure html and transfer the data in multipart form-data format with a http request on host/datatransfer.php
– DubZ
Mar 7 at 15:37
add a comment |
It is also quite easy to make forms and send them via post/get in html. For me, it is sometimes a pain to do it in another language.
add a comment |
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
Writing unobtrusive JavaScript that works using progressive enhacement continues to be best practise because there are plenty of circumstances where JavaScript fails.
Aside from that, just because you can do something with JavaScript doesn't mean you should do something with JavaScript. Often a regular form submission will give all the desired effects with less work.
And on top of that, a form is a useful element to collect data with even if you do use JavaScript. For example, you can use a form element to populate a FormData
element.
Forms provide semantic data to group form controls, this is heavily used by screen readers.
As mentioned in comments, some password managers use them to identify grouped login form controls.
4
Adding a specific example to why preserving standard semantics is required: Chrome's user/password/credentials autofill only works if the inputs are inside aform
element that is submitted. It won't save anything otherwise.
– Sergiu Paraschiv
Mar 7 at 9:51
Weather unobtrusive JavaScript continues to be best practice is questionable. There are a ton of web-apps that either do not support it or even cannot support it. There too few no-js users their support is very costly.
– Gherman
Mar 7 at 13:52
add a comment |
Writing unobtrusive JavaScript that works using progressive enhacement continues to be best practise because there are plenty of circumstances where JavaScript fails.
Aside from that, just because you can do something with JavaScript doesn't mean you should do something with JavaScript. Often a regular form submission will give all the desired effects with less work.
And on top of that, a form is a useful element to collect data with even if you do use JavaScript. For example, you can use a form element to populate a FormData
element.
Forms provide semantic data to group form controls, this is heavily used by screen readers.
As mentioned in comments, some password managers use them to identify grouped login form controls.
4
Adding a specific example to why preserving standard semantics is required: Chrome's user/password/credentials autofill only works if the inputs are inside aform
element that is submitted. It won't save anything otherwise.
– Sergiu Paraschiv
Mar 7 at 9:51
Weather unobtrusive JavaScript continues to be best practice is questionable. There are a ton of web-apps that either do not support it or even cannot support it. There too few no-js users their support is very costly.
– Gherman
Mar 7 at 13:52
add a comment |
Writing unobtrusive JavaScript that works using progressive enhacement continues to be best practise because there are plenty of circumstances where JavaScript fails.
Aside from that, just because you can do something with JavaScript doesn't mean you should do something with JavaScript. Often a regular form submission will give all the desired effects with less work.
And on top of that, a form is a useful element to collect data with even if you do use JavaScript. For example, you can use a form element to populate a FormData
element.
Forms provide semantic data to group form controls, this is heavily used by screen readers.
As mentioned in comments, some password managers use them to identify grouped login form controls.
Writing unobtrusive JavaScript that works using progressive enhacement continues to be best practise because there are plenty of circumstances where JavaScript fails.
Aside from that, just because you can do something with JavaScript doesn't mean you should do something with JavaScript. Often a regular form submission will give all the desired effects with less work.
And on top of that, a form is a useful element to collect data with even if you do use JavaScript. For example, you can use a form element to populate a FormData
element.
Forms provide semantic data to group form controls, this is heavily used by screen readers.
As mentioned in comments, some password managers use them to identify grouped login form controls.
edited Mar 7 at 10:28
answered Mar 7 at 9:47
QuentinQuentin
657k728951056
657k728951056
4
Adding a specific example to why preserving standard semantics is required: Chrome's user/password/credentials autofill only works if the inputs are inside aform
element that is submitted. It won't save anything otherwise.
– Sergiu Paraschiv
Mar 7 at 9:51
Weather unobtrusive JavaScript continues to be best practice is questionable. There are a ton of web-apps that either do not support it or even cannot support it. There too few no-js users their support is very costly.
– Gherman
Mar 7 at 13:52
add a comment |
4
Adding a specific example to why preserving standard semantics is required: Chrome's user/password/credentials autofill only works if the inputs are inside aform
element that is submitted. It won't save anything otherwise.
– Sergiu Paraschiv
Mar 7 at 9:51
Weather unobtrusive JavaScript continues to be best practice is questionable. There are a ton of web-apps that either do not support it or even cannot support it. There too few no-js users their support is very costly.
– Gherman
Mar 7 at 13:52
4
4
Adding a specific example to why preserving standard semantics is required: Chrome's user/password/credentials autofill only works if the inputs are inside a
form
element that is submitted. It won't save anything otherwise.– Sergiu Paraschiv
Mar 7 at 9:51
Adding a specific example to why preserving standard semantics is required: Chrome's user/password/credentials autofill only works if the inputs are inside a
form
element that is submitted. It won't save anything otherwise.– Sergiu Paraschiv
Mar 7 at 9:51
Weather unobtrusive JavaScript continues to be best practice is questionable. There are a ton of web-apps that either do not support it or even cannot support it. There too few no-js users their support is very costly.
– Gherman
Mar 7 at 13:52
Weather unobtrusive JavaScript continues to be best practice is questionable. There are a ton of web-apps that either do not support it or even cannot support it. There too few no-js users their support is very costly.
– Gherman
Mar 7 at 13:52
add a comment |
one reason is if, for any reason, javascript is disabled / not allowed but an application still should work.
1
just with pure html... <form action="datatransfer.php" method="multipart/form-data"> is pure html and transfer the data in multipart form-data format with a http request on host/datatransfer.php
– DubZ
Mar 7 at 15:37
add a comment |
one reason is if, for any reason, javascript is disabled / not allowed but an application still should work.
1
just with pure html... <form action="datatransfer.php" method="multipart/form-data"> is pure html and transfer the data in multipart form-data format with a http request on host/datatransfer.php
– DubZ
Mar 7 at 15:37
add a comment |
one reason is if, for any reason, javascript is disabled / not allowed but an application still should work.
one reason is if, for any reason, javascript is disabled / not allowed but an application still should work.
answered Mar 7 at 9:50
DubZDubZ
1416
1416
1
just with pure html... <form action="datatransfer.php" method="multipart/form-data"> is pure html and transfer the data in multipart form-data format with a http request on host/datatransfer.php
– DubZ
Mar 7 at 15:37
add a comment |
1
just with pure html... <form action="datatransfer.php" method="multipart/form-data"> is pure html and transfer the data in multipart form-data format with a http request on host/datatransfer.php
– DubZ
Mar 7 at 15:37
1
1
just with pure html... <form action="datatransfer.php" method="multipart/form-data"> is pure html and transfer the data in multipart form-data format with a http request on host/datatransfer.php
– DubZ
Mar 7 at 15:37
just with pure html... <form action="datatransfer.php" method="multipart/form-data"> is pure html and transfer the data in multipart form-data format with a http request on host/datatransfer.php
– DubZ
Mar 7 at 15:37
add a comment |
It is also quite easy to make forms and send them via post/get in html. For me, it is sometimes a pain to do it in another language.
add a comment |
It is also quite easy to make forms and send them via post/get in html. For me, it is sometimes a pain to do it in another language.
add a comment |
It is also quite easy to make forms and send them via post/get in html. For me, it is sometimes a pain to do it in another language.
It is also quite easy to make forms and send them via post/get in html. For me, it is sometimes a pain to do it in another language.
answered Mar 7 at 10:09
AntonAnton
152
152
add a comment |
add a comment |
7
For accessibility
– R3tep
Mar 7 at 9:47
1
Main use case of form element and for that many element is providing information about your html file to whoever is reading and to search engines.
– binariedMe
Mar 7 at 9:47
1
Maybe rephrase it like "what are the advantages of using
form
tags" instead of "why should we still use"? Then it's less option-based. The question is very interesting.– Gherman
Mar 7 at 13:55