file1.cshtml
<pre><form id="cust" name="Customer" method="post">
<div>
<p>@Html.TextBoxFor(m => m.Email, new { required = "required", placeholder = "Email", id = "cust-email", maxlength = 255 })</p>
<label id="lbl-cust-email-error" class="error error-label-style">@Html.ValidationMessageFor(m => m.Email)</label>
<small class="field-tip">Use your real email address. We don't spam.</small>
</div>
<div>
<input id="submit-cust" type="submit" value="Join"/>
</div></form>
file2.cshtml
<pre><div id="Customeridentity" hidden="hidden" class="registration_form_element">
@Html.Partial("_file1")
</div>
<script>
$("body").on("click", "#submit-cust", function () {
var formValidator = $("form#cust").data('kendoValidator');
if(formValidator.validate()){
$.ajax({
type: 'POST',
url: '@Url.Action("IsCustomerModelStateValid", "Account")',
data: form.serialize(),
success: function (data) {
isClickedJoinFreightRover = false;
if (data.IsValid) {
$(".field-validation-error").hide();
var registerUrl = '@Url.Action("RegisterCustomer", "Account")',
}
else {
$('#Customeridentity').html(data);
}
}
});
}
});
</script>
first time click with wrong data kendo validator is working.
After
$('#Customeridentity').html(data) append and next again submit the kendo validator is undefined error show.The data is coming same form and with error value.
What I have tried:
I have tried almost all possibility