Should be as simple as setting an onClick for the okDialog button to send the value to a variable or use the value straight away.
var myVal;
okDialog.onClick = function(){
myVal = textFiled.text;
}
You could also set an onChanging instead to have the value send in realtime as the user types. With each character entered it would just straight save to your variable. Gotta be careful though as malicious code could also quickly be sent into your script, depending on how you are handling the data the user enters.
okDialog.onChanging = function(){
myVal = textFiled.text;
}