Answered
ScriptUI field validation
Can a scriptUI dialog check if the value entered in the text field is valid?

For example, if the field is empty, display an alert that the field can not be empty.

Can a scriptUI dialog check if the value entered in the text field is valid?

For example, if the field is empty, display an alert that the field can not be empty.

See this if it's okay for you.
var regExp = new RegExp();
win = new Window("dialog", "TEST",undefined);
var textInput =win.add("edittext", undefined, "TEXT");
textInput.characters = 20;
textInput.active = true;
closeBtn =win.add("button", undefined, "CLOSE");
closeBtn.onClick = function () {
if (textInput.text == "")
alert("ALERT !!!\nEMPTY EDITTEXT?");
else {
win.hide();
}
}
win.show();
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.