ConfirmIt 3D Grid open text validation

The script checks if the text in the checked open-text answer in a 3d grid question is filled and displays error if it's blank.

//surveyscripting.com

var a = f("Q1_a");
var b = f("Q1_b");
var c = a.domainValues();

for(var i=0; i < c.length; i++) {
    if(a[c[i]].toBoolean() && b[c[i]].toBoolean()) {
       RaiseError();
       a[c[i]].set(null); //setting the open-text value null - for testing purposes
       SetQuestionErrorMessage(9, "The other-specify choice must be exclusive.");
    }
    if(!a[c[i]].toBoolean() && !b[c[i]].toBoolean()) {
       RaiseError();
       SetQuestionErrorMessage(9, "You must provide answer to the question.");
    }
}