使用jquery和Javascript禁用日历 [英] Disable a calendar using jquery and Javascript

查看:106
本文介绍了使用jquery和Javascript禁用日历的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我正在使用日历并通过使用js函数禁用日历并从后面的代码中调用它。控件转到它后面的代码执行jquery行没有任何错误,但日历没有禁用。我使用的jquery系列是





I am using a calendar and i m disabling the calendar by using js function and calling that from code behind .The control goes to code behind it executes the jquery line without any errors but calender is not disabling. The jquery line i have used is

$('.' + getcssname).datepicker('disable');





其中getcssname是我从后面的代码传递的datepicker的相应文本框的类名。相同的jquery行和js函数在除1页之外的所有其他页面中工作正常。我不知道为什么同样的函数在其他页面中工作的相同代码在这里不起作用。我正在传递正确的textboxid或类名,但仍然无法正常工作。我还尝试过其他方式:





where getcssname is the classname of the corresponding textbox of the datepicker which i m passing from code behind. The same jquery line and js function is working fine in all other pages except 1 page.. I have no idea why same function same code which works in other pages is not working here. I am passing correct textboxid or classname but still its not working. I also tried other ways like:

$('.' + getcssname).datepicker('disable');
           $('.' + getcssname).datepicker('option', 'disabled', true);
           $("#MainBody_PayRollSchedule_txt1stPayrollDate").datepicker('disable');





所有这些方式也没有禁用日历。我还检查了任何脚本错误以及Web开发人员工具中的控制台没有任何显示。请你能帮我解决问题并解开日历。提前感谢你。



All these ways also did not disable the calendar. I also checked for any Script errors and also the console in web developer tools there is nothing showing. Please Please can you help me in solving the problem and disbling calendar. Thanking You in advance.

推荐答案

('。'+ getcssname).datepicker('disable');
('.' + getcssname).datepicker('disable');





其中getcssname是我从后面的代码传递的datepicker的相应文本框的类名。相同的jquery行和js函数在除1页之外的所有其他页面中工作正常。我不知道为什么同样的函数在其他页面中工作的相同代码在这里不起作用。我正在传递正确的textboxid或类名,但仍然无法正常工作。我还尝试过其他方式:





where getcssname is the classname of the corresponding textbox of the datepicker which i m passing from code behind. The same jquery line and js function is working fine in all other pages except 1 page.. I have no idea why same function same code which works in other pages is not working here. I am passing correct textboxid or classname but still its not working. I also tried other ways like:


('。'+ getcssname).datepicker( 'disable');
('.' + getcssname).datepicker('disable');


('。'+ getcssname).datepicker('option','disabled',true);
('.' + getcssname).datepicker('option', 'disabled', true);


这篇关于使用jquery和Javascript禁用日历的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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