如何使用 Kendo UI 中的验证禁用表单中的提交按钮
我有一个包含 2 个输入字段和下拉选项的表单。我怎样才能禁用提交按钮,直到并且除非两个字段都正确填写
<form method="POST" id="formcheck">
<label>first</label>
<select class="" id="first" name="first"></select>
<label>second</label>
<select class="" id="second" name="second"></select>
<input type="submit" id="submitForm" value="Submit">
</form>
在我的js文件中我已经写了这个,这是正确的吗?
$("#first").kendoValidator();
$("#second").kendoValidator();
I have a form of 2 input fields with dropdown options. How can I disable the submit button until and unless both the fields are filled correctly
<form method="POST" id="formcheck">
<label>first</label>
<select class="" id="first" name="first"></select>
<label>second</label>
<select class="" id="second" name="second"></select>
<input type="submit" id="submitForm" value="Submit">
</form>
In my js file I have written this, is this correct?
$("#first").kendoValidator();
$("#second").kendoValidator();
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
查看客户端表单验证文档以了解表单验证的基础知识。
然后查看 Telerik 的验证器概述文档和验证器演示。
您可以使用
required
属性强制输入。然后使用表单上的验证器。
Check out the Client-side form validation documentation to understand the basics of form validation.
Then look at Telerik's Validator Overview documentation and the Validator demo.
You can use the
required
attribute to make an input mandatory.Then use the validator on the form.
试试这个(在普通js中):
Try this (in vanilla js):