0

I used jQuery form validation to make sure the data entered by the user are of correct format. However, the user may disable his/her browser's javascript and enters garbage data. How can I solve this problem?

4
  • Always validate on the server too. Commented Apr 29, 2013 at 7:21
  • Still people disable javascript in browser? Commented Apr 29, 2013 at 7:22
  • Use server side validation. Commented Apr 29, 2013 at 7:22
  • @arjuncc, I guess they just want to hack into the system. Commented Apr 29, 2013 at 11:40

2 Answers 2

5

It is always a good practise to do serverside validation also.Don't depend on client too much.

You SHOULD NOT assume the validation successfully done at client side is 100% perfect. No matter even if it serves less than 50 users. You never know which of your user/emplyee turn into an "evil" and do some harmful activity knowing you dont have proper validations in place.

I recommend you to go through:JavaScript: client-side vs. server-side validation

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

Comments

0

If you want to force the user to use JavaScript, you can use

<body>

<noscript>
Javascript is disabled.
<meta HTTP-EQUIV="REFRESH" content="0; url=http://www.yourweb.com/message_page"> 
</noscript>

</body>

HTML 5 have some validation features, but most of the modern browser doesn't fully support it.

4 Comments

Interesting... Where should I put the code? in the <head> element?
@Tang you can put it in the body part of the page.
Even if you do this, you can't trust the client.
@JanDvorak yep, we can't trust the user!

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.