5 ui.CheckField = ui.AbstractField.extend({
6 _main_template: function() { return (
7 { tag: "DIV", id: this.id(), cls: "uiCheckField", children: [
8 { tag: "INPUT", type: "checkbox", name: this.config.name, checked: !!this.config.value }
11 validate: function() {
12 return this.val() || ( ! this.require );
14 val: function( val ) {
15 if( val === undefined ) {
16 return !!this.field.attr( "checked" );
18 this.field.attr( "checked", !!val );