Skip to content

Instantly share code, notes, and snippets.

@simpluslabs
Created November 13, 2018 12:32
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 simpluslabs/d2e8ce378e809de798e4afec2964f00d to your computer and use it in GitHub Desktop.
Save simpluslabs/d2e8ce378e809de798e4afec2964f00d to your computer and use it in GitHub Desktop.
({
validateContactForm: function(component) {
var validContact = true;
// Show error messages if required fields are blank
var allValid = component.find('contactField').reduce(function (validFields, inputCmp) {
inputCmp.showHelpMessageIfInvalid();
return validFields && inputCmp.get('v.validity').valid;
}, true);
return allValid;
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment