I do not have my computer with me, so I can not provide an example, but @Html.ValidationSummary() returns an unordered list of errors. (see http://msdn.microsoft.com/en-us/library/dd460343(v=vs.108).aspx )
You can check if @Html.ValidationSummary() value in JavaScript, and then use jQuery to pull out the text values ββof the <li> elements and put them in a warning.
Try this, I have not tested it yet, but this should be a guide:
<script> var validationSummary = '@Html.ValidationSummary()'; var alerttext = ''; if (validationSummary !== '') { $(validationSummary) .find('li').each( function() { alerttext = alerttext + $(this).text() + '\n'; }); alert(alerttext); } </script>
source share