Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

Responsive site using flex

@scoltelli27

Desktop design screenshot for the Intro component with sign-up form coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


I used just html for the form validation since its already integrated. I didn't see any particular benefit on doing it through javascript, maybe someone can clarify that for me? What's the point on validating through js if it can be done with html and the browser?

Community feedback

@victorsonet

Posted

Hey, The reason you want to use JS instead of HTML is because with JS you can make certain user limitations, for example not letting submit the page when certain inputs are empty or only allowing passwords that have one uppercase letter and 8 letters long etc. Normally without JS (which works on the client side) validation the user data goes instantly to the server and that will do the validation which takes longer time then doing it on the client side, where you instantly get the feedback and you don't make extra work for the server either. I hope this answered your question!

Marked as helpful

1

@scoltelli27

Posted

@victorsonet Thank you so much for the answer! I get it now!

1

@KaustubhMaladkar

Posted

Hi. JS is used for form validation because of the flexibility and customisations it provides. But, the most important reason is cyber security. HTML code can easily be changed by just changing the code using the inspector. This is not true for javascript. Sending corrupted files to the server can be extremely dangerous. Hope you found this helpful!

0

Please log in to post a comment

Log in with GitHub
Discord logo

Join our Discord community

Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!

Join our Discord