如何禁用Jquery DateTimePicker图像按钮。 [英] How to disable Jquery DateTimePicker image button.

查看:109
本文介绍了如何禁用Jquery DateTimePicker图像按钮。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



如何禁用JqueryDateTime Picker Image按钮。

但是文本框我可以禁用,我不能做图像按钮。



这里代码我试试吧。



Hi,
How to disable JqueryDateTime Picker Image button .
But textbox i can disable ,I can't do Image button.

here code i am try it.

function disableDate() {
    debugger;
    document.getElementById('txtStartDate').disabled = true;
    $get('txtStartDate').style.color = "gray";
    $get('txtStartDate').disabled = true;




    $('txtStartDate').datepicker('disable');

    $('txtStartDate').datepicker('setDate', new Date()).datepicker('disable').blur();


    $('txtStartDate').disableSelection = true;


}







<input id="txtStartDate"  runat="server" class="TextBox DatePicker" 
                                            style="width: 125px" />





脚本:





script:

        <style>
 .ui-datepicker-trigger
        {
            position: relative;
            top: 4px;
            right: -3px;
            height: 17px;
        }
        </style>
        <script language="javascript" type="text/javascript">
            var Dformat = "";
            $(document).ready(function () {
                var selectvalStartDate = $("#txtStartDate").val();
                var sVal = document.getElementById('hdnPORTALID').value;
                Dformat = GetDatePickerFormat(sVal);
                $(".DatePicker").attr("placeholder", "Select date").datepicker({
                    showOn: "both",
                    buttonImage: "../images/datepicker_enable.png",
                    buttonImageOnly: true,
                    changeMonth: true,
                    changeYear: true,
                    dateFormat: Dformat
                });

            });
</script>





谢谢,

Karthikeyan,



thanks,
Karthikeyan,

推荐答案

get(' txtStartDate')。style.color = grey;
get('txtStartDate').style.color = "gray";


get(' txtStartDate')。disabled = true ;
get('txtStartDate').disabled = true;


' txtStartDate')。datepicker(' 禁用');
('txtStartDate').datepicker('disable');


这篇关于如何禁用Jquery DateTimePicker图像按钮。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆