Please call the extended 'autoHeight' method.
(function($){
function setHeight(target){
var opts = $(target).textbox('options');
$(target).next().css({
height: '',
minHeight: '',
maxHeight: ''
});
var tb = $(target).textbox('textbox');
tb.css({
height: 'auto',
minHeight: opts.minHeight,
maxHeight: opts.maxHeight
});
tb.css('height', 'auto');
var height = tb[0].scrollHeight;
tb.css('height', height+'px');
}
function autoHeight(target){
var opts = $(target).textbox('options');
var onResize = opts.onResize;
opts.onResize = function(width,height){
onResize.call(this, width, height);
setHeight(target);
}
var tb = $(target).textbox('textbox');
tb.unbind('.tb').bind('keydown.tb keyup.tb', function(e){
setHeight(target);
});
setHeight(target);
}
$.extend($.fn.textbox.methods, {
autoHeight: function(jq){
return jq.each(function(){
autoHeight(this);
})
}
})
})(jQuery);
$('#dbhPurpose').textbox('autoHeight');