There are attributes in html for forms so that you can disable them, e.g.:
<input name="inputName" id="inputId" type="text" disabled="disabled" value="the text">
Not all form types have "disabled" as the "disabling" attribute, look at
http://www.w3schools.com/tags/default.asp and find the attributes for your form types.
In order to dynamically disable them you could use JavaScript's DOM support, e.g. the above input could be disabled like this:
document.getElementById('inputId').setAttribute('disabled','disabled');
and re-enable like:
document.getElementById('inputId').removeAttribute('disabled);
You could go different ways doing this depending on your needs.
Good luck to you.