Welcome to the Treehouse Community
Looking to learn something new?
Submit vs. Click event
Hi folks, could someone explain why is submit a better choice for forms? If I use submit instead of click event it will provide more information for the backend process?
I know from the teachers note, that submit is fired only on the form element, not the button or submit input. But why is better then click?
Diego ROJAS1,781 Points
Submit is great because it sends all the data into the URL which is one way.
It's great for google searches when you click the little search icon. For bigger chunks of data it's or sensitive info it's not recommended and other AJAX tools exist
Submit basically sends data to the server using the URL
If you're not going to be working in backend I don't think that'll be much use to you :D
Hope that helps