Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disabling manual inputs for KendoUI elements

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.

like image 737
Maven Avatar asked Dec 26 '22 07:12

Maven


1 Answers

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

like image 102
Petur Subev Avatar answered Jan 09 '23 12:01

Petur Subev