如何禁用客户端验证字段明智 [英] How to disable client side validation field wise

查看:56
本文介绍了如何禁用客户端验证字段明智的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我的表单有5个字段,并且前两个将在客户端进行验证,下一个将不会,但下一个将被验证.我得到了类似的指导

suppose my form has 5 fields and first two will be validated at client side and next one will not but next will. i got the guidance like

<div class="editor-field">
    @{ Html.EnableClientValidation(false); }
    @Html.TextBoxFor(m => m.BatchId, new { @class = "k-textbox" })
    @{ Html.EnableClientValidation(true); }
</div>

但是它不起作用.我写了Html.EnableClientValidation(true)

but it did not work. i wrote Html.EnableClientValidation(true)

在第二个字段之后和第三个字段之前,我写了Html.EnableClientValidation(false) 再一次,我在第四场之前写了Html.EnableClientValidation(true).但是我看到所有字段都在客户端得到了验证. 谢谢

and after second field and before 3rd field i wrote Html.EnableClientValidation(false) and again i wrote Html.EnableClientValidation(true) before 4th field. but i saw all fields are getting validated at client side. thanks

推荐答案

尝试@Html.TexBoxFor(model => model.BatchId, new {@class = "k-textbox", data_val = false})

这应该禁用对字段的验证

That should disable validation for field

这篇关于如何禁用客户端验证字段明智的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆