case 'opac.default_phone':
var tb = new dijit.form.TextBox({scrollOnFocus:false}, getByName(row, 'widget'));
tb.attr('value', userSettings[stype.name()]);
+ tb.isValid = function() {
+ if (this.value.match(/^\s*$/) || this.value.match(/^\d{3}-\d{3}-\d{4}$/)) {
+ return true;
+ }
+ };
if (stype.name() === 'opac.default_sms_notify') {
dojo.create("div", {innerHTML: "<img id='sms_lookup_result'></img>"}, row);
}
}
} else {
dojo.style(tb.domNode, "background-color", "yellow");
+ alert("Invalid value for " + stype.label());
}
userSettingsToUpdate[stype.name()] = newVal; });
break;