How can I make HTML values safe from change by browsers
some examples
textarea
<textarea maxlength="50"></textarea>
any one can change maxlength value
and <a href="#" rel="15" >Like</a>
any one can change rel value and rel value id of post
i use event.preventDefault();
on jquery
but sometimes i need change value by jquery any help
thanks
A better solution would be to perform your sanitation and validation server-side (such as ASP), which cannot be modified by the browser. Any HTML can be modified in the browser.
Basically the way to look at validation is this:
Client Side Validation - can be used to provide "instant" feedback to the user. That way users have difficulty typing in too many characters or invalid values. This also gives them feedback before they move off the data entry field so they can quickly fix errors. As others have said this is NEVER a substitute for server validation
Server Side Validation - This is your actual validation. Assume everything coming from the client is suspect. You need to check for "html" characters (if you aren't escaping output later on pages). You need to check the length of the data. And of course you need to check any other business rules you might have. Repeat: Assume all input is suspect!
For those familiar with client/server programming this may seem like common sense, but its always important to keep in mind. Hope this helps some!