I have a two RadDateInput fields: one to contain the date itself, and the other to contain the time in military format. I also have a "Now" button that I want to allow the user to push and populate the fields with the current date and time. The date field works, but the time does not. The time field gets '00:00'. I am trying to do this client-side to avoid the round-trip.
The code in my ASPX page contains:
When the user clicks the button, it populates the date field, but it puts 00:00 in the time field.
Thank you in advance for your help!
The code in my ASPX page contains:
function setReqDateNow() {
var d = new Date();
var reqDate = $find("<%= reqDate.ClientID %>");
var reqTime = $find("<%= reqTime.ClientID %>");
reqDate.set_selectedDate(d);
reqTime.set_selectedDate(d);
}
...
<
telerik:RadDateInput
ID
=
"reqDate"
runat
=
"server"
DisplayDateFormat
=
"MM/dd/yyyy"
Width
=
"75"
BackColor
=
"#fbf5bb"
/>
<
telerik:RadToolTip
ID
=
"tipReqDate"
runat
=
"server"
HideEvent
=
"LeaveTargetAndToolTip"
TargetControlID
=
"reqDate"
Position
=
"BottomRight"
RelativeTo
=
"Element"
ShowEvent
=
"OnMouseOver"
Text
=
"mm/dd/yyyy format less than or equal to today's date"
/>
<
telerik:RadDateInput
ID
=
"reqTime"
runat
=
"server"
DisplayDateFormat
=
"HH:mm"
Width
=
"50"
BackColor
=
"#fbf5bb"
/>
<
telerik:RadToolTip
ID
=
"tipReqTime"
runat
=
"server"
HideEvent
=
"LeaveTargetAndToolTip"
TargetControlID
=
"reqTime"
Position
=
"BottomRight"
RelativeTo
=
"Element"
ShowEvent
=
"OnMouseOver"
Text
=
"Enter time in hh:mm format"
/>
<
asp:Button
ID
=
"btnNow"
runat
=
"server"
Text
=
"Now"
OnClientClick
=
"setReqDateNow();return false;"
/>
When the user clicks the button, it populates the date field, but it puts 00:00 in the time field.
Thank you in advance for your help!