1

I am using jQuery to disable some form buttons. Simple stuff. But how can I prevent users from editing the DOM and enabling the button themselves so they can work around the restrictions I put in place?

2
  • 1
    You cannot! You have to use server side logic script as PHP Commented Jan 7, 2013 at 16:57
  • 1
    This question may be of use to you. Keep in mind that the client cannot be trusted to validate its own input to your server. Commented Jan 7, 2013 at 17:00

4 Answers 4

10

You can't. The client is completely under the control of the user.

You can only handle what data you accept when it is submitted to the server.

Use client side code to make things convenient for users. Use server side code to enforce security and other restrictions.

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

1 Comment

Thank you. I understand. Thus I need to validate every input in the server-side.
1

You can't. The DOM is entirely handled by the browser. Once you've sent off the page to the client, it's out of your hands. All you can do is keep track of whether an action is allowed on the server, and allow or disallow it when they try.

Comments

1

You can't force the user to do anything, neither can you prevent them from doing anything. If you could, spammers would have a field day.

This is why EVERYTHING MUST be validated on the server-side.

Comments

0

You can't!!! Once the DOM is at the client side you don't have control over it the best way to ensure security is to handle it also via server side.

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.