Reputation: 613
I have implemented the date picker as below:
$( ".apprvd_input_date" ).datepicker({
changeMonth: true,
changeYear: true,
showOn: "both",
buttonImage: "../resources/images/date_picker.gif",
buttonImageOnly: true
});
I have <h:inputText disabled="#{bean.readOnly}" styleClass="apprvd_input_date" size="8"/>
I control the disabled property from bean variable and now the text box is disabled but still it allows me to pick the date using date picker. Can i hide the date picker icon on when it is disabled? I have around 10 textboxes using the date picker and wanna to do it for all.
Upvotes: 1
Views: 3953
Reputation: 1550
You will have to manually hide that date picker icon as:
fiddle: https://jsfiddle.net/rmdf32za/
function disableDate(){
$(".ui-datepicker-trigger").addClass("hide");
$(".apprvd_input_date").attr("disabled","disabled");
}
.hide{
display:none;
}
Upvotes: 1