There is no need to modify the original jquery.validate.unobtrusive.js. The answer is something like this: How can I customize the unobtrusive validation in ASP.NET MVC 3 to match my style?
But you have to be careful: if you just change errorPlacement with your implementation probably the form will submit even when errors are present. To avoid that you need to preserve the content of the onError function of jquery.validate.unobtrusive.js.
Put this code in one of your files:
var $form = $("form.edit-form")
var validator = $form.data('validator');
validator.settings.errorPlacement = $.proxy(onError, $form);
function onError(error, inputElement) {
//Original code of the onError function inside jquery.validate.unobtrusive
//------------------------------------------------------------------------
var container = $(this).find("[data-valmsg-for='" + inputElement[0].name + "']"),
replace = $.parseJSON(container.attr("data-valmsg-replace")) !== false;
container.removeClass("field-validation-valid").addClass("field-validation-error");
error.data("unobtrusiveContainer", container);
if (replace) {
container.empty();
error.removeClass("input-validation-error");
}
else {
error.hide();
}
//END of Original code of the onError function inside jquery.validate.unobtrusive
//-------------------------------------------------------------------------------
//Do whatever you want here, in my case I'm using qTip to show the errors
var element = inputElement;
// Set positioning based on the elements position in the form
var elem = $(element);
// Check we have a valid error message
if (!error.is(':empty')) {
// Apply the tooltip only if it isn't valid
elem.filter(':not(.valid)').qtip({
overwrite: false,
content: error,
position: {
my: 'left middle',
at: 'right middle',
viewport: $(window)
},
show: {
event: false,
ready: true
},
hide: false,
style: {
classes: 'ui-tooltip-red' // Make it red... the classic error colour!
}
})
// If we have a tooltip on this element already, just update its content
.qtip('option', 'content.text', error);
}
// If the error is empty, remove the qTip
else { elem.qtip('destroy'); }
}