(A little clarification below.)You can either use the readonly attribute or the disabled attribute:<input type="text" readonly="readonly" ...<input type="text" disabled="disabled" ...The difference is that the disabled attribute will gray out the text field while the readonly attribute will not. On Firefox, the text in a disabled text field cannot be selected and copied to the clipboard.You can also use JavaScript to set the readonly or disabled attribute:var field = document.getElementById('fieldId');field.readOnly = true;var field = document.getElementById('fieldId');field.disabled = true;