Disable nothing in JavaScript Feb06 '06

document.forms[0].elements[0].disabled = true;

This "grays out" a form element, essentially "locking" it, so the user can’t edit it.

But what’s the point of this, when the user can just turn off JavaScript, in the browser, and submit/edit the form as they wish??

Even though it is very handy - as a security measure, it’s probably best not to rely on this - for anything.

Categories: JavaScript

Add Feedback (view all)

Leave feedback

Feedback

Input format: The editor controls below will assist with Markdown syntax.

Status

Sub-status

Your info

This would certainly not be useful if you were trying to make an app more secure. For that you need to take different measures. That would be don ... Read more.

matthom is published and produced by Matt Thommes - an independent publishing enthusiast, mobile blogger, content creator, informative writer, web developer from Chicago. Never one to conform, Matt intends to promote the effect the web has on our lives, in an effort to intensify, instruct, and clarify all that is happening around us.

Contact Matt

Similar Entries

Stats

63 unique visits since August 2008

Syndicate

Advertisements