function HappyField(happyForm, $happyField, options) {
    var opt;
    HappyItem.call(this, 'field', 'inputs', $happyField, options, happyForm);
    if ( ! this.id) { this.id = this.happyType + nextHappyId++; }
    $.extend(this, unserialize(this.$elm[0].getAttribute('data-happy')));
    this.childItems = this.inputs = this.getInputs();
    this.input = this.inputs[0];
    this.$elm.data(this.id, this);
    this.label = this.getOpt('label') || this.$elm.data('label');
    this.error = new HappyError(this);
    this.required = this.$elm[0].hasAttribute('required') || this.getOpt('required') || (this.input && this.input.$elm[0].hasAttribute('required'));
    this.type = this.$elm.data('type') || this.resolveOpt('fieldType') || (this.input && this.input.type) || 'text'; // OR textarea, checkgroup, radiogroup, etc.
    opt = this.happyParent.getOpt('messageSelector' );  if (opt) { this.messageSelector = opt;  }  // only override the existing proto method if an alternative is provided!
    opt = this.happyParent.getOpt('messageTemplate' );  if (opt) { this.messageTemplate = opt;  }
    opt = this.happyParent.getOpt('messageText'     );  if (opt) { this.messageText = opt;      }
    this.initialValue = this.val(true);
  }
// NB: Property assign order matters for this class!
Property assign order matters for this class!
Property assign order matters for this class!
function HappyField(happyForm, $happyField, options) {
    var opt;
    HappyItem.call(this, 'field', 'inputs', $happyField, options, happyForm);
    if ( ! this.id) { this.id = this.happyType + nextHappyId++; }
    $.extend(this, unserialize(this.$elm[0].getAttribute('data-happy')));
    this.childItems = this.inputs = this.getInputs();
    this.input = this.inputs[0];
    this.$elm.data(this.id, this);
    this.label = this.getOpt('label') || this.$elm.data('label');
    this.error = new HappyError(this);
    this.required = this.$elm[0].hasAttribute('required') || this.getOpt('required') || (this.input && this.input.$elm[0].hasAttribute('required'));
    this.type = this.$elm.data('type') || this.resolveOpt('fieldType') || (this.input && this.input.type) || 'text'; 
    opt = this.happyParent.getOpt('messageSelector' );  if (opt) { this.messageSelector = opt;  }  
    opt = this.happyParent.getOpt('messageTemplate' );  if (opt) { this.messageTemplate = opt;  }
    opt = this.happyParent.getOpt('messageText'     );  if (opt) { this.messageText = opt;      }
    this.initialValue = this.val(true);
  }
function HappyField ( happyForm , $happyField , options ) { var opt ; HappyItem . call ( this , 'field' , 'inputs' , $happyField , options , happyForm ) ; if ( ! this . id ) { this . id = this . happyType + nextHappyId ++ ; } $ . extend ( this , unserialize ( this . $elm [ 0 ] . getAttribute ( 'data-happy' ) ) ) ; this . childItems = this . inputs = this . getInputs ( ) ; this . input = this . inputs [ 0 ] ; this . $elm . data ( this . id , this ) ; this . label = this . getOpt ( 'label' ) || this . $elm . data ( 'label' ) ; this . error = new HappyError ( this ) ; this . required = this . $elm [ 0 ] . hasAttribute ( 'required' ) || this . getOpt ( 'required' ) || ( this . input && this . input . $elm [ 0 ] . hasAttribute ( 'required' ) ) ; this . type = this . $elm . data ( 'type' ) || this . resolveOpt ( 'fieldType' ) || ( this . input && this . input . type ) || 'text' ; opt = this . happyParent . getOpt ( 'messageSelector' ) ; if ( opt ) { this . messageSelector = opt ; } opt = this . happyParent . getOpt ( 'messageTemplate' ) ; if ( opt ) { this . messageTemplate = opt ; } opt = this . happyParent . getOpt ( 'messageText' ) ; if ( opt ) { this . messageText = opt ; } this . initialValue = this . val ( true ) ; }
NB: Property assign order matters for this class!
NB : Property assign order matters for this class!
// OR textarea, checkgroup, radiogroup, etc. // only override the existing proto method if an alternative is provided!