How to disable or read only DHIS2 Custom Data Entry Fields

Add the "disabled" attribute in the data element: disabled="disabled"

Example: 

<-input disabled="disabled" id="hxZP6fofrgZ-dCWAvZ8hcrs-val" name="entryfield" title="Inj.Ampicillin2_ClosingBalance" value="[ Inj.Ampicillin2_ClosingBalance ]" -/>