Submit Forms on Enter
The following example demonstrates how to submit a form when the Enter
key is pressed by the user.
<form id="form1" style="border: 1px solid red">
<input id="datepicker" />
<button>Submit</button>
</form>
<script>
$(function() {
var form = $("#form1");
$("#datepicker").kendoDatePicker();
form.on("submit", function(e) {
e.preventDefault();
alert("submit!");
});
});
</script>
See Also
- DatePicker JavaScript API Reference
- How to Set the First Weekday
- How to Create Date Masking
- How to Globally Modify Default Options
- How to Hide the Default Button
- How to Integrate DatePicker with DateJS Library
- How to Make Input Elements Readonly
- How to Persist Entered Dates
- How to Resize Calendar Based on Input Width
For more runnable examples on the Kendo UI DatePicker, browse its How To documentation folder.