1

During client-side form validation certain parts can be validated using html(using the required or type attribute in <input>). I can achive those same things using js. So, what parts of the form validation should be done in js and what parts can be left for html? Which one is more safe?

3
  • 2
    This questions is a little too broad for StackOverflow. Do you have a specific problem you're having? It may be a better fit for programmers.stackexchange.com Commented Dec 29, 2014 at 18:27
  • HTML5 input validation does not cover the size or types of input files. See a related SO question for further info. Commented Dec 29, 2014 at 18:29
  • the maxlength attribute in input tag? Commented Dec 29, 2014 at 18:30

1 Answer 1

1

HTML5 validation is convenient but it depends on your audience. HTML5 validations are not supported by some older browsers (here is the list: http://caniuse.com/#feat=form-validation). Also I've noticed a Safari bug: the form doesn't validate (expected behavior) but the pop up error message doesn't display leaving the user unsure of the issue.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.