/*dynamic form validation requires jquery present and the validation module loaded*/ $(window).load(function(){ $('form').each(function(){ $(this).validate({ errorPlacement: function(error, element) { $('#'+element.attr('id')+'-err').css('display','block'); } }); }); $(':input.required').each(function() { var thisid = this.id; if(thisid != '' && $('#'+thisid+'-err').length == 0) { var el = $(this); var position = el.offset(); var elwidth = el.width(); var label = el.attr('validation-label'); if(label == undefined || label == "") { label = "Please enter a value"; } $('body').append('
'+label+'