Returns 'form-check-input' if widget is CheckboxInput or 'form-control-file'
        if widget is FileInput. For all other fields return the default value
        from the form property ("form-control").
426163
def get_widget_css_class(self, field_name, field):
        
        # If we render CheckboxInputs, Bootstrap requires a different
        # widget css class for checkboxes.
        if isinstance(field.widget, forms.CheckboxInput):
            return 'form-check-input'

        # Idem for fileinput.
        if isinstance(field.widget, forms.FileInput):
            return 'form-control-file'

        return super().get_widget_css_class(field_name, field)
1284984
protected function checkBox()
	{
		$attribute = $this->attribute;
		echo '<div class="controls">';
		echo '<label class="checkbox" for="' . $this->getAttributeId($attribute) . '">';
		echo $this->form->checkBox($this->model, $attribute, $this->htmlOptions) . PHP_EOL;
		echo $this->model->getAttributeLabel($attribute);
		echo $this->getError() . $this->getHint();
		echo '</label></div>';
	}
432196
def default_value(self):
        
        if not hasattr(self, "_default_value"):
            if self.elem_type == "select":
                try:
                    # Get option marked "selected"
                    def_value = get_option_value(self.elem.select_one("[selected]"))
                except AttributeError:
                    # ...or if that one doesen't exist get the first option
                    def_value = get_option_value(self.elem.select_one("option"))

            elif self.elem_type == "checkbox":
                def_value = self.elem.get("value")

            elif self.elem_type == "radio":
                def_value = [x for x in self.elem if x.has_attr("checked")][0].get("value")

            self._default_value = def_value

            assert def_value is not None

        return self._default_value
1318721
public function getInput() {
		if (!isset($this->input)) {
			switch ($this->method) {
			case 'POST':
				switch ($this->getContentType()) {
				case 'application/x-www-form-urlencoded':
				case 'multipart/form-data':
					$this->input = $_POST;
					break;

				default:
					$this->input = $this->getParamsFromInput();
					break;
				}
				break;

			case 'PUT':
			case 'DELETE':
				$this->input = $this->getParamsFromInput();
				break;

			default:
				$this->input = [];
				break;
			}
		}

		return $this->input;
	}
569060
function (element) {
            var submittable = /^(?:input|select|textarea|keygen)/i;
            var submitterTypes = /^(?:submit|button|image|reset|file)$/i;
            var type = element.type;
            var checkableTypes = /^(?:checkbox|radio)$/i;

            return element.name && !element.disabled && submittable.test(element.nodeName)
                    && !submitterTypes.test(type) && (element.checked || !checkableTypes.test(type));
        }
402406
function () {
            var cfg = this._cfg;
            return ariaCoreBrowser.isIE11 && cfg.waiAria && cfg.disabled && this._isChecked() && cfg._inputType === "checkbox";
        }
585629
def checkbox_check(self, force_check=False):
        
        if not self.get_attribute('checked'):
            self.click(force_click=force_check)
109712
def GetValue(self):
    '''
    
    '''
    self.AssertInitialization('Optional')
    value = self._widget.GetValue()
    if not value or len(value) <= 0:
      return None
    return ' '.join(
      [self._action.option_strings[0],  # get the verbose copy if available
       value])
815082
def confirm_value(self, widget):
        
        self.hide()
        params = (self.fileFolderNavigator.get_selection_list(),)
        return params
253133
function _parseFormControl(form_id, form_control) {
        var value = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;

        var type = this._collection[form_id].getInputType(form_control);

        console.log(type);

        // check if parser for specific input type exists and call it instead
        var method = type.toLowerCase();
        method = method.charAt(0).toUpperCase() + method.slice(1); // upper case first char
        method = '_parseFormControl' + method;

        if (value === undefined) {
            method = method + 'Getter';
        }

        if (this[method] !== undefined) {
            return this[method](form_id, form_control, value);
        } else {
            // call default parser
            // if input with same name exists - override
            if (value === undefined) {
                return this._parseFormControlDefaultGetter(form_id, form_control);
            } else {
                this._parseFormControlDefault(form_id, form_control, value);
            }
        }
    }
506642
function(form, field) {
        var fieldsArray,
            fieldValue,
            fieldElement,
            i = 0;

        // Instead of trusting that the first element returned is the actual field, we will go ahead
        // and test if the field is truly within the form that we are validating against.
        fieldsArray = document.getElementsByName(field);

        for (; i<fieldsArray.length; i++) {
            fieldElement = fieldsArray[i];

            // We are running a simple test to see if the current field in the returned array is part of
            // our validating field or not.  If it is then grab it's value and break out of this test loop.
            if (fieldElement.form && fieldElement.form.name === form) {
              if (['radio', 'checkbox'].indexOf(fieldElement.type) !== -1 && !fieldValue) {
                    if(fieldElement.checked) {
                        fieldValue = fieldElement.value;
                        break;
                    } else {
                        fieldValue = "";
                        continue;
                    }
                } else {
                    fieldValue = fieldElement.value;
                }
                break;
            }
        }

        // If no field value was stored then we will assume that the field couldn't be found.  An empty string is
        // not considered a "non-stored field value."
        if (! fieldValue && fieldValue !== "")
            throw new Error("Couldn't find the field element " + field + " for the form " + form + ".");

        return fieldValue;
    }
438996
def get_edit_form(obj, field_names, data=None, files=None):
    

    # Map these form fields to their types defined in the forms app so
    # we can make use of their custom widgets.
    from yacms.forms import fields
    widget_overrides = {
        forms.DateField: fields.DATE,
        forms.DateTimeField: fields.DATE_TIME,
        forms.EmailField: fields.EMAIL,
    }

    class EditForm(forms.ModelForm):
        """
        In-line editing form for editing a single model field.
        """

        app = forms.CharField(widget=forms.HiddenInput)
        model = forms.CharField(widget=forms.HiddenInput)
        id = forms.CharField(widget=forms.HiddenInput)
        fields = forms.CharField(widget=forms.HiddenInput)

        class Meta:
            model = obj.__class__
            fields = field_names.split(",")

        def __init__(self, *args, **kwargs):
            super(EditForm, self).__init__(*args, **kwargs)
            self.uuid = str(uuid4())
            for f in self.fields.keys():
                field_class = self.fields[f].__class__
                try:
                    widget = fields.WIDGETS[widget_overrides[field_class]]
                except KeyError:
                    pass
                else:
                    self.fields[f].widget = widget()
                css_class = self.fields[f].widget.attrs.get("class", "")
                css_class += " " + field_class.__name__.lower()
                self.fields[f].widget.attrs["class"] = css_class
                self.fields[f].widget.attrs["id"] = "%s-%s" % (f, self.uuid)
                if settings.FORMS_USE_HTML5 and self.fields[f].required:
                    self.fields[f].widget.attrs["required"] = ""

    initial = {"app": obj._meta.app_label, "id": obj.id,
               "fields": field_names, "model": obj._meta.object_name.lower()}
    return EditForm(instance=obj, initial=initial, data=data, files=files)
27167
function getFieldType($, $input) {
    // Check for simple properties that determine type.
    if($input.is('textarea')) { return 'text-multi'; }
    if($input.is('[type="checkbox"]')) { return 'checkbox'; }
    if($input.is('[type="file"]')) { return 'file'; }

    // Check for <select>-based inputs.
    if($input.is('select')) {
      if($input.hasClass('font')) { return 'font'; }
      if($input.hasClass('blog')) { return 'blog'; }
      if($input.hasClass('collection')) { return 'collection'; }
      if($input.hasClass('linklist')) { return 'linklist'; }
      if($input.hasClass('page')) { return 'page'; }
      if($input.hasClass('snippet')) { return 'snippet'; }
      return 'select';
    }

    // Text-based inputs.
    if($input.hasClass('color')) { return 'color'; }

    return 'text-single';
  }
270039
function( name, value, options, checked ) {
        options = options || {};
        if(checked) options.checked = "checked";
        return this.input_field_tag(name, value, 'checkbox', options);
    }
767038
def get_form_class(self, request, plugins, plugin):
        
        widget = self.get_editor_widget(
            request=request,
            plugins=plugins,
            plugin=plugin,
        )

        instance = plugin.get_plugin_instance()[0]

        if instance:
            context = RequestContext(request)
            context['request'] = request
            rendered_text = plugin_tags_to_admin_html(
                text=instance.body,
                context=context,
            )
        else:
            rendered_text = None

        # We avoid mutating the Form declared above by subclassing
        class TextPluginForm(self.form):
            body = CharField(widget=widget, required=False)

            def __init__(self, *args, **kwargs):
                initial = kwargs.pop('initial', {})

                if rendered_text:
                    initial['body'] = rendered_text
                super(TextPluginForm, self).__init__(*args, initial=initial, **kwargs)
        return TextPluginForm
122752
public function widgetId()
    {
        if (!$this->widgetId) {
            $type = $this->type();
            switch ($type) {
                case static::PROPERTY_DISPLAY:
                    $id = $this->display()->displayId();
                    break;

                case static::PROPERTY_CONTROL:
                    $id = $this->input()->inputId();
                    break;

                default:
                    $id = 'widget_'.uniqid();
                    break;
            }

            $this->widgetId = $id;
        }

        return $this->widgetId;
    }
863934
function getValType(el) {
        var ret = el.tagName.toLowerCase()
        return ret === "input" && /checkbox|radio/.test(el.type) ? "checked" : ret
    }