This question is locked. New answers and comments are not allowed.
Hi,
I have three radio buttons and three Date Picker's based on that i want to enable and disable Calender Icon to prevent selection.
I was able to make dtp read only and Calender Image hide when it was only one place but now if i use show/hide Calender image its reflecting for all three Date Picker's.
See code:
What i want now is, Either i am able to Show/Hide Calender Image for associated Date Picker's or i am able to enable/disable perticular Date Picker control using JQuery.
Hope i am able to justify my question. See the attached image.
I have three radio buttons and three Date Picker's based on that i want to enable and disable Calender Icon to prevent selection.
I was able to make dtp read only and Calender Image hide when it was only one place but now if i use show/hide Calender image its reflecting for all three Date Picker's.
See code:
function
toggleInput(selectedCondition) {
if
(selectedCondition ==
"byDays"
) {
$(
"#txtDays"
).removeAttr(
"readonly"
);
$(
"#dtpDateRange"
).attr(
"readonly"
,
"true"
);
$(
"#dtpFromDate"
).attr(
"readonly"
,
"true"
);
$(
"#dtpToDate"
).attr(
"readonly"
,
"true"
);
$(
".t-icon-calendar"
).hide();
$(
"#dtpDateRange"
).val(
""
);
$(
"#dtpFromDate"
).val(
""
);
$(
"#dtpToDate"
).val(
""
);
}
else
if
(selectedCondition ==
"byDateRange"
) {
$(
"#dtpDateRange"
).attr(
"readonly"
,
"true"
);
$(
"#dtpDateRange"
).val(
""
);
$(
"#dtpFromDate"
).removeAttr(
"readonly"
);
$(
"#dtpToDate"
).removeAttr(
"readonly"
);
$(
"#txtDays"
).attr(
"readonly"
,
"true"
);
$(
".t-icon-calendar"
).show();
$(
"#txtDays"
).val(
"0"
);
}
else
{
$(
"#dtpDateRange"
).removeAttr(
"readonly"
);
$(
"#dtpFromDate"
).attr(
"readonly"
,
"true"
);
$(
"#dtpFromDate"
).val(
""
);
$(
"#dtpToDate"
).attr(
"readonly"
,
"true"
);
$(
"#dtpToDate"
).val(
""
);
$(
"#txtDays"
).attr(
"readonly"
,
"true"
);
$(
".t-icon-calendar"
).show();
$(
"#txtDays"
).val(
"0"
);
}
}
What i want now is, Either i am able to Show/Hide Calender Image for associated Date Picker's or i am able to enable/disable perticular Date Picker control using JQuery.
Hope i am able to justify my question. See the attached image.