Text Field to Read-Only at Runtime

I am using the sc_field_readonly on a text field at runtime to make the contents of a field as readonly after the values in it have been confirmed. Doing so changes it but empties the contents. What am I doing incorrectly or is there some better way?

i dont know what you are doing wrong but its OK with me. Can you list some code snippet up to where you use the sc_field_readonly({field}, on); ?