Skip to content

Instantly share code, notes, and snippets.

@albertomario
Created July 11, 2018 13:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save albertomario/ddb7142b2fab762d7c44a4fecefd710b to your computer and use it in GitHub Desktop.
Save albertomario/ddb7142b2fab762d7c44a4fecefd710b to your computer and use it in GitHub Desktop.
validator.addRule(
'customer-type-validation',
function (value) {
console.log(value);
var customerTypeSelector = $('[name=custom_attributes\\[customer_type\\]] option:selected').text();
console.log(customerTypeSelector);
if(value === 'hello') {
return true;
} else {
return false;
}
}
,$.mage.__('Custom Validation message.')
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment