Add the following CSS / JS as a reference jquery-ui.css, jquery-1.8.2.min.js, jquery-ui-1.8.24.min.js, jquery.validate.min.js, jquery.validate.unobtrusive .min.js
$(document).ready(function () { $('#Test').bind('invalid-form.validate', function (form, validator) { var $list = $('<ul />') if (validator.errorList.length) { $.each(validator.errorList, function (i, entity) { $("<li />").html(entity.message).appendTo($list); }); msgbox('Please correct following errors:', $('<div />').append($list)); return false; } }); }); function msgbox(_title, _messageHtml) { $('<div></div>').appendTo('body') .html(_messageHtml) .dialog({ modal: true, title: _title, zIndex: 10000, autoOpen: true, width: 'auto', resizable: false, buttons: { Ok: function () {
source share