You could use the Enable() message, like this:
names default to here(1);
CheckInput = function({},
write("here");
UserInput1 = String1 << get text();
UserInput2 = String2 << get text();
if(
(length(UserInput1) > 0 ) & (length(Userinput2) > 0),
bbOK << Enable(1),
bbOK << Enable(0)
)
);
// User Interface Window to get some data
UIwin = New Window( "User Input",
Show Menu( 0 ),
Show Toolbars( 0 ),
<<Modal,
H List Box(
V List Box(
Panel Box( "",
Spacer Box( size( 250, 5 ) ),
H Center Box( Text Box( "User Input 1", <<Set Font Size( 11 ) ) ),
H Center Box( String1 = Text Edit Box( "", Hint( "User Input 1" ), <<set width( 150 ), << Set Script( CheckInput() ) ) ),
Spacer Box( size( 5, 5 ) ),
H Center Box( Text Box( "User Input 2", <<Set Font Size( 11 ) ) ),
Spacer Box( size( 5, 5 ) ),
H Center Box( String2 = Text Edit Box( "", Hint( "User Input 2" ), <<set width( 150 ), << Set Script( CheckInput() ) ) ),
Spacer Box( size( 2, 25 ) ),
),
),
),
bbOK = Button Box ("OK",
UserInput1 = String1 << get text();
UserInput2 = String2 << get text();
, << Enable(0)
),
Button Box ("Cancel", UIwin),
);