I'm trying to add JavaScript to allow users to select today's date by pressing "T" key. I've copied the following code from elsewhere in this forum. Sorry, I cannot find original post. The below code does exactly what what we want except the t is showing up in the text. For example, "8/4/2015t" is what is being displayed.
Is there a way to prevent key press from being propagated? Below is demo code that I'm working with.
<
telerik:RadDatePicker
ID
=
"DatePicker1"
runat
=
"server"
>
<
DateInput
ClientEvents-OnKeyPress
=
"DateTextBoxKeyPress"
/>
</
telerik:RadDatePicker
>
function DateTextBoxKeyPress(sender, args) {
var s1 = args.get_keyCharacter().toUpperCase();
if (s1 === "T") {
var datePicker = sender;
var date = new Date();
date.setDate(date.getDate());
datePicker.set_selectedDate(date);
}
}