This is a migrated thread and some comments may be shown as answers.

How to disable current Date Picker's Calender icon using JQuery

0 Answers 48 Views
Date/Time Pickers
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Rajneesh
Top achievements
Rank 2
Rajneesh asked on 26 Apr 2013, 05:15 AM
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:
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.

 
Tags
Date/Time Pickers
Asked by
Rajneesh
Top achievements
Rank 2
Share this question
or