Hello Matt,
The following seems to work fine for me and below is attached a video that shows the expected behavior. Could you take a look at my test and see whether I am missing something? If so, can you show me what it is and what the problematic scenario is, so I can take a look?
<telerik:RadDatePicker runat=
"server"
ID=
"RDP_TerminationDate"
></telerik:RadDatePicker>
<telerik:RadDatePicker runat=
"server"
ID=
"RDP_ResignationDate"
></telerik:RadDatePicker>
<telerik:RadButton runat=
"server"
ID=
"rb1"
OnClientClicking=
"ClientSubmit"
Text=
"Submit"
></telerik:RadButton>
<telerik:RadWindowManager runat=
"server"
ID=
"rwm1"
></telerik:RadWindowManager>
<script>
function
ClientSubmit(sender, args) {
var
tdate = $find(
"<%=RDP_TerminationDate.ClientID %>"
);
var
rdate = $find(
"<%=RDP_ResignationDate.ClientID %>"
);
alert(tdate.get_selectedDate());
alert(rdate.get_selectedDate());
//you may want to use a logical OR operator instead of AND, depending on the logic that is desired
//for example:
//if (tdate.get_selectedDate() == null || rdate.get_selectedDate() == null) {
if
(tdate.get_selectedDate() ==
null
&& rdate.get_selectedDate() ==
null
) {
radalert(
"Please select a termination or resignation date.<br/><br/>Thank you."
, 300, 180,
"Attention"
,
null
,
null
);
//you may want to execute this logic in the callback function of the radalert
if
(tdate.get_selectedDate() ==
null
&& rdate.get_selectedDate() !=
null
) {
tdate.showPopup();
}
else
{
rdate.showPopup();
}
args.set_cancel(
true
);
}
}
</script>
Regards,
Marin Bratanov
Progress Telerik