php - How to prevent characters in Bootstrap datepicker text box from firebug?

414

Here i have a text box which generates dates from Bootstrap date-picker, and working very well.

But whenever user tries to change their value from firebug, then its changed..!

Something like this:

enter image description here

Changed value

enter image description here

I want to prevent this. but how?

200

Answer

Solution:

There's no way to control the code when is on the client-side, so we can't prevent the user edits the input like he wants with firebug or another browser inspector.

That's why we should validate any single piece of data that comes from the client on the server side.

788

Answer

Solution:

You simply can't.

Code inspectors are designed for debugging HTML and Javascript. They do so by showing the live DOM object of the web page. That means it reveals HTML code of everything you see on the page, even if they're generated by Javascript. Some inspectors even shows the code inside iframes.

People are also looking for solutions to the problem: How can I debug a 500 Internal Server error (IIS 8.5 Windows Server 2012 R2) where the fastcpi (php-cgi.exe) seems to crash once every few days

Source

Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.