How to restrict GUI Text Area to only accept numeric input?

Hi,
I write this simple code. What I want is the GUI.TextArea could only accept the numeric input. I have try the Event method but the text area didn’t show.

    var text : String;
    
    function OnGUI()
    {
       text = GUI.TextArea(Rect(Screen.width/2 + 80, Screen.height/2 + 95, 90, 60), text);
    }

somebody help me?
thank’s a lot

The way to do will depend on how you wan to treat the problem. Most simple way in my opinion is:

function OnGUI()
{            
      text = GUI.TextArea(Rect(Screen.width/2 + 80, Screen.height/2 + 95, 90, 60), text);
      for (int i = 0;i <text.Length;i++)
      {
          if (text _< '0' || text *> '9')*_

text = “”;
}
}
But this will not inform the user about anything wrong, only it will remove the content if not appropriate and the method is called every round of the OnGUI.
string previousText = null;
function OnGUI()
{
text = GUI.TextArea(Rect(Screen.width/2 + 80, Screen.height/2 + 95, 90, 60), text);
if(text != previousText)
{
for (int i = 0;i <text.Length;i++)
{
if (text < ‘0’ || text > ‘9’)
text = “Only numbers are allowed”;
}
}
previousText = text;
}
I guess that should do.