There is legit way of registering custom validation attributes for both serves side Model and for client side.
This is dirty way ...
Just create in doom so small that is not visible (NOT HIDDEN! ) input with same dom name.
<span asp-validation-for="ImageRaw" style="padding-left:15px" class="text-danger"></span>
<input style="width:0px;border:0px!important;padding:0px;" type="text" asp-for="ImageRaw" />
If you hide it JQuery validation will ignore it. Through JQ apply changes to real input on the hidden one.
$(document).on('change', 'input[name="PersonImage"]', function () {$('input#ImageRaw').val($(this).val());});
No comments:
Post a Comment