set field readonly true in javasctip code example Example: javascript set readonly property document.getElementById('InputFieldID').readOnly = true;