Why should we still use form element in html? [closed]

The name of the pictureThe name of the pictureThe name of the pictureClash 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;








9















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?










share|improve this 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 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

















9















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?










share|improve this 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 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













9












9








9


1






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?










share|improve this question














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






share|improve this question













share|improve this question











share|improve this question




share|improve this question










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 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












  • 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







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












3 Answers
3






active

oldest

votes


















14














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.






share|improve this answer




















  • 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











  • 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


















2














one reason is if, for any reason, javascript is disabled / not allowed but an application still should work.






share|improve this answer


















  • 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


















2














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.






share|improve this answer





























    3 Answers
    3






    active

    oldest

    votes








    3 Answers
    3






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    14














    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.






    share|improve this answer




















    • 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











    • 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















    14














    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.






    share|improve this answer




















    • 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











    • 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













    14












    14








    14







    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.






    share|improve this answer















    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.







    share|improve this answer














    share|improve this answer



    share|improve this answer








    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 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












    • 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











    • 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













    2














    one reason is if, for any reason, javascript is disabled / not allowed but an application still should work.






    share|improve this answer


















    • 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















    2














    one reason is if, for any reason, javascript is disabled / not allowed but an application still should work.






    share|improve this answer


















    • 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













    2












    2








    2







    one reason is if, for any reason, javascript is disabled / not allowed but an application still should work.






    share|improve this answer













    one reason is if, for any reason, javascript is disabled / not allowed but an application still should work.







    share|improve this answer












    share|improve this answer



    share|improve this answer










    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












    • 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











    2














    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.






    share|improve this answer



























      2














      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.






      share|improve this answer

























        2












        2








        2







        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.






        share|improve this answer













        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.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 7 at 10:09









        AntonAnton

        152




        152












            Popular posts from this blog

            How to check contact read email or not when send email to Individual?

            Displaying single band from multi-band raster using QGIS

            How many registers does an x86_64 CPU actually have?