html - Javascript: Using forms vs NOT using forms for data submission -


nowadays doesn't seem matter whether use forms or not submitting data. personally, seem end getting values necessary inputs, manually, using javascript, upon submission of form (or button intended trigger function grabs input data off page).

are there major differences between using forms submit data directly on grabbing needed elements off page , using ajax send data?

edit: appreciate explanations if you're going downvote. haven't seen question asked before on stackoverflow plus standards change pretty nowadays , new developers might wonder point of using form on manually grabbing inputs.

using forms recommended due following:

  1. forms provide backwards compatibility devices don't @ css or use javascript.
  2. with forms can use tools parsley.js grab wbole form, validate , send off part of ajax without bothering validating every single field in script.
  3. other developers expect see form because that's how html meant be, omitting one, introduce unusual code, in turn mean wasted time other developers when take on code.

so don't reinvent wheel , use forms :)


Comments

Popular posts from this blog

html - Styling progress bar with inline style -

java - Oracle Sql developer error: could not install some modules -

How to use autoclose brackets in Jupyter notebook? -