add description option to FormItem

This commit is contained in:
rolux 2011-11-30 15:44:35 +01:00
parent 8c34d09861
commit ec4a1c0605

View file

@ -22,9 +22,16 @@ Ox.FormItem = function(options, self) {
error: '', error: '',
}) })
.options(options || {}) .options(options || {})
.addClass('OxFormItem') .addClass('OxFormItem');
.append(self.options.element);
self.description = self.options.element.options('description');
if (self.description) {
$('<div>')
.addClass('OxFormDescription')
.html(self.description)
.appendTo(that);
}
that.append(self.options.element);
self.$message = Ox.Element() self.$message = Ox.Element()
.addClass('OxFormMessage') .addClass('OxFormMessage')
.appendTo(that); .appendTo(that);