The problem is that your code that adds the tooltip only runs once after the DOM is ready. You need to call it for every element that you disable.
A simple solution would be to write a method for your tooltip:
function AddToolTip() {
d = $("<div>");
i = $(this);
d.css({
height: i.outerHeight(),
width: i.outerWidth(),
position: "absolute",
})
d.css(i.offset());
d.attr("title", i.attr("title"));
d.tooltip();
return d;
}
Then, use this method to apply the tooltip to the elements that are disabled on DOM ready
$('input:disabled, button:disabled').after(AddToolTip);
On disabling an input element, call the method again
$('#test').prop('disabled', true).after(AddToolTip);