Saturday 14 July 2012

Zend Form, and auto height of a textarea

Zend framework has it's uses. But gee it can be a pain at times.

If you don't have access to the decorators of the form, and you want to style your text areas better, this snippet should come in handy. Stupid scroll bars.

var textArea = "";
jQuery('textarea.info').each(function() {
                    textArea = jQuery(this);
                    textArea.removeAttr('rows');
                    textArea.removeAttr('cols');
                    textArea.css('height', this.scrollHeight + 'px');
                });

No comments:

Post a Comment