Advertisement
Guest User

Untitled

a guest
May 27th, 2015
250
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. // form validation loaded from config
  2. $('.ui.form').each(function(index){
  3. var config = $(this).data('config');
  4. if(config !== undefined) {
  5.  
  6. $(this).prepend('<div class="ui icon error message" id="form-errors"></div>');
  7.  
  8. var settings = APP.config.validation;
  9.  
  10. config.split('.').forEach(function(el, i, arr){
  11. settings = settings[el];
  12. });
  13.  
  14. $('#form-'+settings.id).form(
  15. settings.rules,
  16. $.extend({}, APP.config.forms.global.options, settings.options)
  17. );
  18. }
  19. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement