In this there is a minor error (gives a Javascript warning) in that the input parameter "h" is redeclared as "variable h" at the end. I assume that either the "var" part could be removed, or it could be changed to "var h2" and still have the same effect.

Can you expand a bit on what the comment for this line means? I assume that just having the line causes the browser (all of them, or is this browser specific?) to recalculate the height?

MiscField for 2.0

MiscField for 2.0

Has the advantage that you can choose to add a hidden field to submit the field. However, it does some things differently, like automatically encoding the value when you call setValue. Not so sure this is a good idea.

I found a bug with MiscField in that getName doesn't work. Here is my workaround.

PHP Code:

/**
* Returns the name attribute of the field if available, otherwise the hiddenName if
* available. Returns a null string if neither are available.
*
* @return {String} name The field name or hiddenName.
*/
getName: function(){
//return this.rendered && this.el.dom.name ? this.el.dom.name : (this.hiddenName || '');
// NB: "name" is applied to a div, hence you must use hasAttribute and getAttribute.
// Can't access it as el.dom.name as you would for an input element.
var n = '';
if ( this.rendered && this.el.dom.hasAttribute("name") ) {
n = this.el.dom.getAttribute("name");
} else if (this.hiddenName) {
n = this.hiddenName;
}
return n;
},