You can't uncheck it because you are always forcing the focus to be set on the textField.
If it is blank on exit, you could add code to deselect the checkbox, probably above the setFocus:
this.resolveNode("cbRequired").rawValue = "0";
You could also put code on the textfield so if it isn't null, the checkbox is checked automatically.
If you want to be really tricky and use some extra code, you could do this in tfSomething: exit:
-------------------------------------------------------
var emptyField = app.alert("When cbRequired is checked, tfSomething must not be empty. \n\nDid you want to leave it blank?",2,2, "Blank Field");
if(emptyField == "4") //4 equals yes
{
this.resolveNode("cbRequired").rawValue = "0"; //if it is already blank, just uncheck the checkbox
}
if(emptyField == "3") //3 equals no
{
this.resolveNode("cbRequired").rawValue = "1"; //ensure box is checked
xfa.host.setFocus(this); //if the user didnt intend to leave it blank, focus on the textfield after the checkbox is checked
}
