When you're setting dojo widget properties programmatically, you don't set data-dojo-props, you normally set the actual attribute you want to set. So you would do:
dijit.byId('contactStringId').set("validator", /*whatever validator you want here*/);
A better way to do this is simply by doing this:
var contactStringBox = dijit.byId('contactStringId');
contactStringBox.validator = function() {
/*
*whatever validation code you want here
* like if(this.value === "test") { return false;}
*/
}