Updated code below. This should work.

 

function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
g_form.setValue("requestor",g_user.userID);
//return;
}

if (newValue == 'true') {

g_form.setValue("requestor",g_user.userID);
}

else

{
g_form.setValue("requestor",g_user.userID);
}

//Type appropriate comment here, and begin script below

}