禁用KendoUI元素的手动输入(Disabling manual inputs for KendoUI elements)

编程入门 行业动态 更新时间:2024-10-26 06:25:32
禁用KendoUI元素的手动输入(Disabling manual inputs for KendoUI elements)

我使用很少的KendoUI元素,如ComboBox,DatePicker等。一切正常,但有一个主要问题,这些元素实际上允许手动输入。

例如,在comboBox中,我可以通过点击它来激活一个文本框,这非常危险并且破坏了使用<select>类型列表元素的目的,日期选择器的情况也是如此。

因此,您可以指导如何禁用这些手动输入,并仅限制用户从可用选项中进行选择。

<input id="date" value="@DateTime.Now.Date"/> <select name="need" id="need"> <option value="1">High</option> <option value="2">Normal</option> <option value="3">Low</option> </select> <script type="text/javascript"> $("#date").kendoDatePicker(); $("#need").kendoComboBox(); </script>

请帮助。

I am using few KendoUI elements like ComboBox, DatePicker etc. everything works fine but there is one major problem that these elements actually allow manual input.

For e.g. in the comboBox I can type by clicking on it which activates a text box, which is really dangerous and spoils the purpose of using a <select> type list elements, same is the case with date picker.

So can you guide how can I disable these manual inputs and only restrict user to the select from the available options.

<input id="date" value="@DateTime.Now.Date"/> <select name="need" id="need"> <option value="1">High</option> <option value="2">Normal</option> <option value="3">Low</option> </select> <script type="text/javascript"> $("#date").kendoDatePicker(); $("#need").kendoComboBox(); </script>

Kindly Help.

最满意答案

如果禁用日期选择器,则不会将其提交给服务器。 更好地使用readonly属性。

If the datepicker is disabled it will not be submitted to the server. Better use the readonly attribute instead.

更多推荐

type,elements,元素,电脑培训,计算机培训,IT培训"/> <meta name="description&

本文发布于:2023-08-02 17:39:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1378729.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:元素   Disabling   KendoUI   elements   inputs

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!