asp.net mvc - MVC Jquery Validation in Model Dialog Not Displaying Summary -
i have next jquery code in function loads partial view , shows in dialog:
ysjs.opencreatedialog = function() { $.ajax({ url: '/yourthings/create/', type: 'get', success: function(result) { $('#create-modal').html(result).dialog({ width: 700, resizable: false, modal: true, buttons: { "create": function () { $("#create-usr").validate(); if (!$("#create-usr").valid()) { homecoming false; } }, cancel: function() { $(this).dialog("close"); } } }).dialog('open'); }, }); };
in partial view forcefulness jquery validation reparse dom this:
<script type="text/javascript"> $(function () { //allow validation framework re-prase dom jquery.validator.unobtrusive.parse(); }); </script>
when click create
button form seems correctly invalidated breakpoint on return false
gets nail in firebug script view.
all other validation on web site functions perfectly, i'm not missing files or settings create unobtrusive validation work there problem in situation summary info never shown.
if place same partial straight on page, validation occurs expected , show messages in ui.
what can seek create sure validaton messages shown user?
i'm not sure how interesting or if it's expected behaviour have fixed changing:
jquery.validator.unobtrusive.parse();
to:
jquery.validator.unobtrusive.parse('#create-usr');
specifying exact form parse shows validation summary correctly within form in dialog.
jquery asp.net-mvc validation
No comments:
Post a Comment