# Disabled TextInput loses textFormat

**URL:** <https://forum.kirupa.com/t/disabled-textinput-loses-textformat/284600>\
**Category:** Uncategorized\
**Created:** [March 20, 2009, 5:27pm UTC](https://forum.kirupa.com/t/disabled-textinput-loses-textformat/284600 "2009-03-20T17:27:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![annettegeek](https://avatars.discourse-cdn.com/v4/letter/a/b38774/32.png) [@annettegeek](https://forum.kirupa.com/u/annettegeek)\
**Post date:** [March 20, 2009, 5:27pm UTC](https://forum.kirupa.com/t/disabled-textinput-loses-textformat/284600/1 "2009-03-20T17:27:42Z")

</div>

I have TextInput with formatting applied. I want the TextInput disabled after the user enters an answer. But disabling the field causes the formatting to disappear. Is there a way to maintain text formatting and still disable the input???

```auto
 
import fl.controls.TextInput;
var myTextInput:TextInput = new TextInput();
myTextInput.move(100, 100);
addChild(myTextInput);
var myFormat:TextFormat= new TextFormat("_sans", 14, 0x0000FF, true, false, false, '', '', TextFormatAlign.CENTER, 0, 0, 0, 0);
myTextInput.setStyle("textFormat", myFormat);
 
myTextInput.addEventListener(Event.CHANGE, checkAnswer);
 
function checkAnswer(event:Event):void{
    trace("check");
    myTextInput.enabled=false;
 }

```
