fires when the value of the key field has been selected
$$("querybuilder").attachEvent("onKeySelect",function(form){ // your logic here });