What does return -1; inside a rule validation mean?

Given "maritalstatus"radio buttons (married,unmarried,divorced,separated), I would then like to validate spouse’s name field ONLY…while other fields for respective unmarried, divorced, separated fields are BYPASSED the validation process (ie. there’s no need to validate these fields). Does return -1 accomplish this?

rules:{
	firstname: webix.rules.isNotEmpty,
        lastname: webix.rules.isNotEmpty,
	address: webix.rules.isNotEmpty,
        spousename:function(data,obj) {
              if(($$('martialstatus').getValue()) == "married")  { return ($$('spousename').getValue()); }
              if(($$('martialstatus').getValue()) == "unmarried")  { return -1; }
              if(($$('martialstatus').getValue()) == "divorced")  { return -1; }
              if(($$('martialstatus').getValue()) == "separated")  { return -1; }
        }

Validation function can have only two possible return values.

  • false ( or 0 or null or empty string ) to mark value invalid
  • any other value marks value valid