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.
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 done server-side making it more difficult to crack.
I would say for 99% of the world this is very effective. The point would be to prevent Johnny Impatient from submitting a webform 43 times. Or you could set up an unobtrusive validation script that only made the submit button available when all required fields were filled. This would be great for improving your usability and making an application more like a desktop ap.