Render the checkbox and the hidden field
774801
function() {
	
   	var checkBoxId = this.divEl.id?this.divEl.id+'-field':YAHOO.util.Dom.generateId();
	   this.el = inputEx.cn('input', { id: checkBoxId, type: 'checkbox' });

	   this.fieldContainer.appendChild(this.el);
	
	   this.rightLabelEl = inputEx.cn('label', {"for": checkBoxId, className: 'inputEx-CheckBox-rightLabel'}, null, this.options.rightLabel);
	   this.fieldContainer.appendChild(this.rightLabelEl);
	
	   // Keep state of checkbox in a hidden field (format : this.checkedValue or this.uncheckedValue)
	   // This is useful for non-javascript form submit (it allows custom checked/unchecked values to be submitted)
	   this.hiddenEl = inputEx.cn('input', {type: 'hidden', name: this.options.name || '', value: this.uncheckedValue});
	   this.fieldContainer.appendChild(this.hiddenEl);
	}
1338310
public function render()
    {
        $uid = helpers_Random::generateString(24);

        $this->addClass('viewable-hiddenbox-input');
        $this->addAttribute('data-identifier', $uid);

        $value = _dh($this->value);

        $html = <<<HTML
<span class="viewable-hiddenbox">
    {$this->renderLabel()}
    <input type='password' name='{$this->name}' id='{$this->name}' {$this->renderAttributes()} value='{$value}'/>
    <span class="viewable-hiddenbox-toggle" data-identifier="{$uid}"></span>
</span>
HTML;

        $script = <<<SCRIPT
<script type="text/javascript">
    (function() {
        var input = document.querySelector('input[data-identifier="$uid"]'),
            toggle = document.querySelector('.viewable-hiddenbox-toggle[data-identifier="$uid"]'),
            
            iconView = document.createElement('span'),
            iconHide = document.createElement('span');
        
        var show = function() {
            if (iconView.parentElement) {
                toggle.removeChild(iconView);
            }
            if (!iconHide.parentElement) {
                toggle.appendChild(iconHide);
            }
            input.type = 'text';
            input.autocomplete = 'off';
            window.addEventListener('mousedown', autoHide); // make sure always submit the form with an password input
            input.focus();
        };
        
        var hide = function() {
            if (!iconView.parentElement) {
                toggle.appendChild(iconView);
            }
            if (iconHide.parentElement) {
                toggle.removeChild(iconHide);
            }
            input.type = 'password';
            input.autocomplete = 'on';
            window.removeEventListener('mousedown', autoHide);
        };
        
        var autoHide = function(event) {
            if (!event.target.isSameNode(input) && !event.target.isSameNode(iconHide) && !event.target.isSameNode(toggle)) {
                hide();
            }
        };
        
        iconView.classList.add('icon-preview');
        iconHide.classList.add('icon-eye-slash');
        hide();
        
        toggle.addEventListener('click', function() {
            if (input.type === 'password') {
                show();
            } else {
                hide();
            }
        });
    })();
</script>
SCRIPT;

        return (string) ($html . $script);
    }
82084
function renderHidden(&$element)
    {
        if ($this->_collectHidden) {
            $this->_ary['hidden'] .= $element->toHtml() . "\n";
        } else {
            $this->renderElement($element, false, null);
        }
    }
1079009
public function renderFields()
    {
        $result = '';
        foreach ($this->fields as $field => $value) {
            $result .= '<input type="hidden" name="' . $field . '" value="' . $value . '"/>' . "\r\n";
        }

        return $result;
    }
723294
function(element) {
            var $element = $(element);
            if ($element.is(':selected')) {
                $element.prop('selected', true);
            }

            // Support the label attribute on options.
            var label = this.options.optionLabel(element);
            var value = $element.val();
            var inputType = this.options.multiple ? "checkbox" : "radio";

            var $li = $(this.options.templates.li);
            var $label = $('label', $li);
            $label.addClass(inputType);

            if (this.options.enableHTML) {
                $label.html(" " + label);
            }
            else {
                $label.text(" " + label);
            }

            var $checkbox = $('<input/>').attr('type', inputType);

            if (this.options.checkboxName) {
                $checkbox.attr('name', this.options.checkboxName);
            }
            $label.prepend($checkbox);

            var selected = $element.prop('selected') || false;
            $checkbox.val(value);

            if (value === this.options.selectAllValue) {
                $li.addClass("multiselect-item multiselect-all");
                $checkbox.parent().parent()
                    .addClass('multiselect-all');
            }

            $label.attr('title', $element.attr('title'));

            this.$ul.append($li);

            if ($element.is(':disabled')) {
                $checkbox.attr('disabled', 'disabled')
                    .prop('disabled', true)
                    .closest('a')
                    .attr("tabindex", "-1")
                    .closest('li')
                    .addClass('disabled');
            }

            $checkbox.prop('checked', selected);

            if (selected && this.options.selectedClass) {
                $checkbox.closest('li')
                    .addClass(this.options.selectedClass);
            }
        }
603644
protected function render_checkbox(): string
    {
        return '<input type="checkbox" '.$this->metaString().
            ' id="'.$this->escape->attr($this->id).
            '" name="'.$this->escape->attr($this->name).
            '" value="1" '.$this->checked(1, $this->value).' />';
    }
822618
private function renderHiddenInputs()
    {
        $items = $this->form->field($this->cartForm, 'productId')
            ->hiddenInput(['value' => $this->product->id])
            ->label(false);
        $items .= $this->form->field($this->cartForm, 'count')
            ->hiddenInput(['value' => self::DEFAULT_PRODUCT_COUNT])
            ->label(false);

        return $items;
    }
825600
public function display()
    {
        $options = $this->getOptions();

        if (!$this->visible || count($options) === 0) {
            return;
        }

        parent::display();

        // outer div is required because the check-all widget is outside the
        // unordered list
        $div_tag = new SwatHtmlTag('div');
        $div_tag->id = $this->id;
        $div_tag->class = $this->getCSSClassString();
        $div_tag->open();

        $current_column = 1;
        $current_option = 0;
        $columns = is_array($this->columns)
            ? $this->columns
            : array(
                ceil(
                    count($options) / ($this->columns > 0 ? $this->columns : 1)
                )
            );

        $multiple_columns = count($options) > $columns[0];
        $maximum_options = array_shift($columns);

        $ul_tag = new SwatHtmlTag('ul');
        if ($multiple_columns) {
            $ul_tag->id = sprintf('%s_column_%s', $this->id, $current_column);
            $ul_tag->class = 'swat-checkbox-list-column';
        }
        $ul_tag->open();

        foreach ($options as $index => $option) {
            if ($current_option == $maximum_options) {
                $ul_tag->close();

                $current_column++;
                $current_option = 0;
                $maximum_options =
                    count($columns) > 0
                        ? array_shift($columns)
                        : $maximum_options;

                $ul_tag->id = sprintf(
                    '%s_column_%s',
                    $this->id,
                    $current_column
                );

                $ul_tag->class = 'swat-checkbox-list-column';

                $ul_tag->open();
            }

            $current_option++;
            $this->displayOption($option, $index);
        }

        $ul_tag->close();

        // Show clear div if columns are used
        if ($multiple_columns) {
            echo '<div class="swat-clear"></div>';
        }

        // Show the check all if more than one checkable item is displayed.
        $check_all = $this->getCompositeWidget('check_all');
        $check_all->visible = $this->show_check_all && count($options) > 1;
        $check_all->display();

        $div_tag->close();

        Swat::displayInlineJavaScript($this->getInlineJavaScript());
    }
1220787
def render(self, name, value, attrs=None, renderer=None):
        """"""
        location = getattr(value, '_seralized_location', '')
        if location and not hasattr(value, 'url'):
            value.url = '#'
            if hasattr(self, 'get_template_substitution_values'):
                # Django 1.8-1.10
                self.template_with_initial = (
                    '%(initial_text)s: %(initial)s %(clear_template)s'
                    '<br />%(input_text)s: %(input)s')
        attrs = attrs or {}
        attrs.update({'data-upload-url': self.url})
        hidden_name = self.get_hidden_name(name)
        kwargs = {}
        if django_version >= (1, 11):
            kwargs['renderer'] = renderer

        parent = super(StickyUploadWidget, self).render(name, value, attrs=attrs, **kwargs)
        hidden = forms.HiddenInput().render(hidden_name, location, **kwargs)

        return mark_safe(parent + '\n' + hidden)
978671
function renderField(fieldName, index) {
      const field = model.provider.getField(fieldName);
      const fieldContainer = d3.select(this);
      let legendCell = fieldContainer.select(`.${style.jsLegend}`);
      let fieldCell = fieldContainer.select(`.${style.jsFieldName}`);

      // Apply style to row (selected/unselected)
      fieldContainer
        .classed(!field.active ? style.selectedRow : style.unselectedRow, false)
        .classed(field.active ? style.selectedRow : style.unselectedRow, true)
        .on('click', (name) => {
          model.provider.toggleFieldSelection(name);
        });

      // Create missing DOM element if any
      if (legendCell.empty()) {
        legendCell = fieldContainer.append('td').classed(style.legend, true);

        fieldCell = fieldContainer.append('td').classed(style.fieldName, true);
      }

      // Apply legend
      if (model.provider.isA('LegendProvider')) {
        const { color, shape } = model.provider.getLegend(fieldName);
        legendCell.html(`<svg class='${
          style.legendSvg
        }' width='${legendSize}' height='${legendSize}' viewBox='${
          shape.viewBox
        }'
                  fill='${color}' stroke='black'><use xlink:href='#${
          shape.id
        }'/></svg>`);
      } else {
        legendCell
          .html('<i></i>')
          .select('i')
          .classed(
            !field.active ? style.selectedRow : style.unselectedRow,
            false
          )
          .classed(
            field.active ? style.selectedRow : style.unselectedRow,
            true
          );
      }

      // Apply field name
      fieldCell.text(fieldName);

      if (model.fieldShowHistogram) {
        let minCell = fieldContainer.select(`.${style.jsHistMin}`);
        let histCell = fieldContainer.select(`.${style.jsSparkline}`);
        let maxCell = fieldContainer.select(`.${style.jsHistMax}`);

        if (histCell.empty()) {
          minCell = fieldContainer.append('td').classed(style.jsHistMin, true);
          histCell = fieldContainer.append('td').classed(style.sparkline, true);
          maxCell = fieldContainer.append('td').classed(style.jsHistMax, true);
          histCell
            .append('svg')
            .classed(style.sparklineSvg, true)
            .attr('width', model.fieldHistWidth)
            .attr('height', model.fieldHistHeight);
        }

        // make sure our data is ready. If not, render will be called when loaded.
        const hobj = model.histograms ? model.histograms[fieldName] : null;
        if (hobj) {
          histCell.style('display', hideField.hist ? 'none' : null);

          // only do work if histogram is displayed.
          if (!hideField.hist) {
            const cmax = 1.0 * d3.max(hobj.counts);
            const hsize = hobj.counts.length;
            const hdata = histCell
              .select('svg')
              .selectAll(`.${style.jsHistRect}`)
              .data(hobj.counts);

            hdata.enter().append('rect');
            // changes apply to both enter and update data join:
            hdata
              .attr(
                'class',
                (d, i) => (i % 2 === 0 ? style.histRectEven : style.histRectOdd)
              )
              .attr('pname', fieldName)
              .attr('y', (d) => model.fieldHistHeight * (1.0 - d / cmax))
              .attr('x', (d, i) => (model.fieldHistWidth / hsize) * i)
              .attr('height', (d) => model.fieldHistHeight * (d / cmax))
              .attr('width', model.fieldHistWidth / hsize);

            hdata.exit().remove();

            if (model.provider.isA('HistogramBinHoverProvider')) {
              histCell
                .select('svg')
                .on('mousemove', function inner(d, i) {
                  const mCoords = d3.mouse(this);
                  const binNum = Math.floor(
                    (mCoords[0] / model.fieldHistWidth) * hsize
                  );
                  const state = {};
                  state[fieldName] = [binNum];
                  model.provider.setHoverState({ state });
                })
                .on('mouseout', (d, i) => {
                  const state = {};
                  state[fieldName] = [-1];
                  model.provider.setHoverState({ state });
                });
            }
          }

          const formatter = d3.format('.3s');
          minCell
            .text(formatter(hobj.min))
            .style('display', hideField.minMax ? 'none' : null);
          maxCell
            .text(formatter(hobj.max))
            .style('display', hideField.minMax ? 'none' : null);
        }
      }
    }
643545
public function renderInput()
    {   
        Html::addCssClass($this->_displayOptions, 'element-' . $this->options['id']);
        Html::addCssClass($this->_displayOptions, 'form-control');
        $this->_displayOptions['rows'] = 1;
        $input = Html::activeTextarea($this->model, $this->attribute, $this->_displayOptions);
        echo $input;
    }
382694
function renderKoboField() {
		$this->renderField(
			[
				'id' => 'kobo',
				'name' => $this->getSlug(),
				'option' => 'kobo',
				'value' => ( isset( $this->options['kobo'] ) ) ? $this->options['kobo'] : '',
				'type' => 'url',
				'class' => 'regular-text code',
			]
		);
	}
543142
public function renderField()
    {
        list($name, $id) = $this->resolveNameID();

        TbArray::defaultValue('id', $id, $this->htmlOptions);
        TbArray::defaultValue('name', $name, $this->htmlOptions);

        TbHtml::addCssClass('bfh-selectbox', $this->wrapperOptions);
        echo CHtml::openTag('div', $this->wrapperOptions);
        if ($this->hasModel()) {
            echo CHtml::activeHiddenField($this->model, $this->attribute, $this->htmlOptions);
            $value = $this->model->{$this->attribute};
            $valueText = $value && isset($this->data[$value]) ? $this->data[$value] : '&nbsp;';
        } else {
            echo CHtml::hiddenField($name, $this->value, $this->htmlOptions);
            $value = $this->value;
            $valueText = $value && isset($this->data[$value]) ? $this->data[$value] : '&nbsp;';
        }

        echo CHtml::openTag(
            'a',
            array(
                'class' => 'bfh-selectbox-toggle',
                'role' => 'button',
                'data-toggle' => 'bfh-selectbox',
                'href' => '#'
            )
        );
        echo CHtml::tag(
            'span',
            array('class' => 'bfh-selectbox-option ' . $this->size, 'data-option' => $value),
            $valueText
        );
        echo CHtml::tag('b', array('class' => 'caret'), '&nbsp;');
        echo CHtml::closeTag('a');

        echo CHtml::openTag('div', array('class' => 'bfh-selectbox-options'));
        if ($this->displayFilter) {
            echo '<input type="text" class="bfh-selectbox-filter">';
        }
        $items = array();
        foreach ($this->data as $key => $item) {
            $items[] = CHtml::tag('a', array('tabindex' => '-1', 'href' => '#', 'data-option' => $key), $item);
        }
        echo CHtml::tag('ul', array('role' => 'options'), '<li>' . implode('</li><li>', $items) . '</li>');
        echo CHtml::closeTag('div');

        echo CHtml::closeTag('div');
    }
459534
public function display()
    {
        $options = $this->getOptions();

        if (!$this->visible || count($options) === 0) {
            return;
        }

        SwatWidget::display();

        $this->getForm()->addHiddenField($this->id . '_submitted', 1);

        $div_tag = new SwatHtmlTag('div');
        $div_tag->id = $this->id;
        $div_tag->class = $this->getCSSClassString();
        $div_tag->open();

        $input_tag = new SwatHtmlTag('input');
        $input_tag->type = 'checkbox';

        $label_tag = new SwatHtmlTag('label');
        $label_tag->class = 'swat-control';

        echo '<table>';

        if ($this->entry_column_title !== null) {
            echo '<thead><tr><th>&nbsp;</th><th>';
            echo $this->entry_column_title;
            echo '</th></tr></thead>';
        }

        // Only show the check all control if more than one checkable item is
        // displayed.
        if ($this->show_check_all && count($options) > 1) {
            echo '<tfoot><tr><td colspan="2">';
            $this->getCompositeWidget('check_all')->display();
            echo '</td></tr></tfoot>';
        }

        echo '<tbody>';
        foreach ($options as $key => $option) {
            echo '<tr><td>';

            $checkbox_id = $key . '_' . $option->value;

            $input_tag->value = (string) $option->value;
            $input_tag->removeAttribute('checked');
            $input_tag->name = $this->id . '[' . $key . ']';

            if (in_array($option->value, $this->values)) {
                $input_tag->checked = 'checked';
            }

            $input_tag->id = $this->id . '_' . $checkbox_id;
            echo '<span class="swat-checkbox-wrapper">';
            $input_tag->display();
            echo '<span class="swat-checkbox-shim"></span>';
            echo '</span>';

            $label_tag->for = $this->id . '_' . $checkbox_id;
            $label_tag->setContent($option->title, $option->content_type);
            $label_tag->display();

            echo '</td><td>';

            $this->getEntryWidget($option->value)->display();

            echo '</td></tr>';
        }
        echo '</tbody>';

        echo '</table>';

        $div_tag->close();

        Swat::displayInlineJavaScript($this->getInlineJavaScript());
    }
570385
function render() {
  var content = $($.parseHTML(template));
  var compiler = Handlebars.compile(content.filter("#layout").html());

  Handlebars.registerPartial({
    leftPanel: content.filter("#left-panel").html(),
    rightPanel: content.filter("#right-panel").html(),
    transactionList: content.filter("#transaction-list").html(),
    transactionDetails: content.filter("#transaction-details").html(),
    transactionOther: content.filter("#transaction-other").html(),
  });

  // Adds selected class to selected transaction item.
  Handlebars.registerHelper('isSelected', function(options) {
    var resp =
      (this.business === dataView.selectedTransaction.business) ?
      "selected" : "";
    return options.fn(resp);
  });

  // Returns fake detail monthly total.
  Handlebars.registerHelper('monthlyTotal', function(options) {
    var total = toCurrency(parseFloat(this.selectedTransaction.amount) * 12);
    return options.fn(total);
  });

  // Returns fake detail yearly total.
  Handlebars.registerHelper('yearlyTotal', function(options) {
    var total = toCurrency(parseFloat(this.selectedTransaction.amount) * 40);
    return options.fn(total);
  });

  var html = compiler(dataView);
  $("#demo-app").html(html);

  addClickHandler();
}
1308091
public function run() {

		list($name, $id) = $this->resolveNameID();

		if ($this->hasModel()) {
			if ($this->form) {
				echo $this->form->checkBox($this->model, $this->attribute, $this->htmlOptions);
			} else {
				echo CHtml::activeCheckBox($this->model, $this->attribute, $this->htmlOptions);
			}
		} else {
			echo CHtml::checkBox($name, $this->value, $this->htmlOptions);
		}

		$this->registerClientScript($id);
	}
536786
public function render()
    {
        // Always add this class
        $this->addClass('autocomplete');

        // Make the hidden field.  Render it before we (might) set the value to
        // the title of the parent.
        $hidden = $this->renderHidden();

        // If there is a value and the field name matches a relationship on function
        // on the current item, then get and display the title text for the related
        // record
        if ($parent = $this->parentModel()) {
            $this->value = $parent->getAdminTitleAttribute();

        // Else, if there is no parent (it's a create page), set the value if a
        // title was set
        } elseif ($this->title) {
            $this->value = $this->title;
        }

        // Add the hidden field and return
        return parent::render().$hidden;
    }