Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Semantic UI - Auto Validation via Data Attrs
// form validation loaded from config
var config = $(this).data('config');
if(config !== undefined) {
$(this).prepend('<div class="ui icon error message" id="form-errors"></div>');
var settings = APP.config.validation;
config.split('.').forEach(function(el, i, arr){
settings = settings[el];
$.extend({},, settings.options)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment