Greets folks,
I want to set the end date to the start date when the start date chages.
I've followed instructions i found on the site to use this code
I'm doing something a little different with regards to showing and hiding controls on the advanced form.
When the form first loads, I am only showing the start date and time.
The user has the ability to specify an end date time but they are not required to.
If the form loads with just the start visible and end hidden, the end date is not getting updated on start date change when the end date control is hidden and it continues to not get updated on start date change even when i use the UI to show the end date.
When debugging I see that the control is accessible but the date values are not correct.
If I successfully save an appointment with a valid start and end date and I go to edit that appointment, my advanced form pops up with both the start and end visible. At this point that changeEndDate function works as expected even when the end date control is hidden using the UI (if a user decides they no longer need an end date they can hide the end date controls).
So the changeEndDate function works when the end date control is visible and hidden ( as I would expect) except for when the form loads with the end date controls hidden (which I don't expect).
The same code is being used to hide the end date controls using a check box similar to how the all day check box hides the time controls.
any tips? this is probably a general html/javascript issue rather than a telerik specific one.
regards
I want to set the end date to the start date when the start date chages.
I've followed instructions i found on the site to use this code
<telerik:RadScriptBlock ID="RadScriptBlock1" runat="server"> |
<script type="text/javascript"> |
function changeEndDate(sender, e) { |
//if start date changes change end date to be greater than start |
var endDatePicker = $find("<%= EndDate.ClientID %>"); |
if ( sender.get_selectedDate() > endDatePicker.get_selectedDate()) { |
endDatePicker.set_selectedDate(sender.get_selectedDate()); |
} |
} |
</script> |
</telerik:RadScriptBlock> |
I'm doing something a little different with regards to showing and hiding controls on the advanced form.
When the form first loads, I am only showing the start date and time.
The user has the ability to specify an end date time but they are not required to.
If the form loads with just the start visible and end hidden, the end date is not getting updated on start date change when the end date control is hidden and it continues to not get updated on start date change even when i use the UI to show the end date.
When debugging I see that the control is accessible but the date values are not correct.
If I successfully save an appointment with a valid start and end date and I go to edit that appointment, my advanced form pops up with both the start and end visible. At this point that changeEndDate function works as expected even when the end date control is hidden using the UI (if a user decides they no longer need an end date they can hide the end date controls).
So the changeEndDate function works when the end date control is visible and hidden ( as I would expect) except for when the form loads with the end date controls hidden (which I don't expect).
The same code is being used to hide the end date controls using a check box similar to how the all day check box hides the time controls.
any tips? this is probably a general html/javascript issue rather than a telerik specific one.
regards