Checks or unchecks the given checkbox, based on the given value.

@param {jQuery} input
@param {*} value
486542
function setCheckbox (input, value) {
  if (!value || value === "true" || value === "on") {
    value = "yes";
  }
  input.val([value]);
}
608885
public function setValue($value)
    {
        $this->checked = (!is_array($value)) ? [$value] : $value;
        if ((count($this->checked) > 0) && ($this->hasChildren())) {
            foreach ($this->childNodes as $child) {
                if ($child instanceof Input\Checkbox) {
                    if (in_array($child->getValue(), $this->checked)) {
                        $child->check();
                    } else {
                        $child->uncheck();
                    }
                }
            }
        }
        return $this;
    }
107507
public void remove(CheckBox checkBox) {

        m_checkboxes.remove(checkBox);
        if (m_selected == checkBox) {
            m_selected = null;
        }
        ValueChangeListener listener = m_listeners.get(checkBox);
        if (listener != null) {
            checkBox.removeValueChangeListener(m_listeners.get(checkBox));
        }
    }
460321
public function checkbox($name = null, $value = null, $status = false, $attr = null)
    {
        $input = $this->createInput('checkbox', $name, $value, $attr);

        if($status)
            $input->attr('checked', true);

        return $input;
    }
769578
protected void setInputElementValue(Node element, FormInput input) {

		LOGGER.debug("INPUTFIELD: {} ({})", input.getIdentification(), input.getType());
		if (element == null || input.getInputValues().isEmpty()) {
			return;
		}
		try {

			switch (input.getType()) {
				case TEXT:
				case TEXTAREA:
				case PASSWORD:
					handleText(input);
					break;
				case HIDDEN:
					handleHidden(input);
					break;
				case CHECKBOX:
					handleCheckBoxes(input);
					break;
				case RADIO:
					handleRadioSwitches(input);
					break;
				case SELECT:
					handleSelectBoxes(input);
			}

		} catch (ElementNotVisibleException e) {
			LOGGER.warn("Element not visible, input not completed.");
		} catch (BrowserConnectionException e) {
			throw e;
		} catch (RuntimeException e) {
			LOGGER.error("Could not input element values", e);
		}
	}
487945
static function checkBox($name, $bit, $attr = array(), $val = true)
    {
        if ($bit == "true" || $bit == 1)
            $attr["checked"] = "true";

        $attr = array_merge(
            array(
                "type" => "checkbox",
            ),
            $attr
        );

        self::input($name, $val, $attr);
    }
278252
@Override
    public boolean condition(Object input) {
        Number n = (Number) input;
        switch (op) {
            case LessThan:
                return n.intValue() < value;
            case LessOrEqual:
                return n.intValue() <= value;
            case GreaterThan:
                return n.intValue() > value;
            case GreaterOrEqual:
                return n.intValue() >= value;
            case Equal:
                return n.intValue() == value;
            case NotEqual:
                return n.intValue() != value;
            case InSet:
                return set.contains(n.intValue());
            case NotInSet:
                return !set.contains(n.intValue());
            default:
                throw new RuntimeException("Unknown or not implemented op: " + op);
        }
    }
879229
def set_checkbox_value(w, value):
    
    save = w.blockSignals(True)
    try:
        w.setChecked(bool(value))
    finally:
        w.blockSignals(save)
29187
def set_input_value(self, selector, value):
        """"""
        script = 'document.querySelector("%s").setAttribute("value", "%s")'
        script = script % (selector, value)
        self.evaluate(script)
247268
void checkedPut(Object value) throws JSONException {
        if (value instanceof Number) {
            JSON.checkDouble(((Number) value).doubleValue());
        }

        put(value);
    }
106582
@SuppressWarnings("unchecked")
    public void setFormValue(Object value) {

        if (value instanceof List<?>) {
            List<String> keys = (List<String>)value;
            Set<String> keySet = new HashSet<String>(keys);
            int i = 0;
            for (Map.Entry<String, String> entry : m_items.entrySet()) {
                String key = entry.getKey();
                CmsCheckBox checkbox = m_checkboxes.get(i);
                checkbox.setChecked(keySet.contains(key));
                i += 1;
            }
        }
    }
102496
public Checkbox setChecked(boolean checked) {
        if (checked) {
            String valueEnabledString = this.getEnabledValueString();
            this.setValue(valueEnabledString);
        } else {
            this.setValue("");
        }

        return this;
    }
1042614
def checkbox_uncheck(self, force_check=False):
        
        if self.get_attribute('checked'):
            self.click(force_click=force_check)
899863
function check_input(input, message) {
  if (!input) {
    error('\n  Error: ' + message);
    program.outputHelp(colors.red);
    process.exit(1);
  }
}
1109354
function(deselectValues) {
            if(!$.isArray(deselectValues)) {
                deselectValues = [deselectValues];
            }

            for (var i = 0; i < deselectValues.length; i++) {

                var value = deselectValues[i];

                var $option = this.getOptionByValue(value);
                var $checkbox = this.getInputByValue(value);

                if($option === void(0) || $checkbox === void(0))
                {
                  continue;
                }

                if (this.options.selectedClass) {
                    $checkbox.parents('li')
                        .removeClass(this.options.selectedClass);
                }

                $checkbox.prop('checked', false);
                $option.prop('selected', false);
            }

            this.updateButtonText();
        }
1185923
function ( obj, value ) {
		var event = "input",
		    output;

		if ( value === undefined ) {
			if ( regex.radio_checkbox.test( obj.type ) ) {
				if ( string.isEmpty( obj.name ) ) {
					throw new Error( label.error.expectedProperty );
				}

				array.each( utility.$( "input[name='" + obj.name + "']" ), function ( i ) {
					if ( i.checked ) {
						output = i.value;
						return false;
					}
				});
			}
			else if ( regex.select.test( obj.type ) ) {
				output = obj.options[obj.selectedIndex].value;
			}
			else if ( "value" in obj ) {
				output = obj.value;
			}
			else {
				output = element.text( obj );
			}

			if ( output !== undefined ) {
				output = utility.coerce( output );
			}

			if ( typeof output === "string" ) {
				output = string.trim( output );
			}
		}
		else {
			value = value.toString();

			if ( regex.radio_checkbox.test( obj.type ) ) {
				event = "click";

				array.each( utility.$( "input[name='" + obj.name + "']" ), function ( i ) {
					if ( i.value === value ) {
						i.checked = true;
						output = i;
						return false;
					}
				});
			}
			else if ( regex.select.test( obj.type ) ) {
				event = "change";

				array.each( element.find( obj, "> *" ), function ( i ) {
					if ( i.value === value ) {
						i.selected = true;
						output = i;
						return false;
					}
				});
			}
			else {
				obj.value !== undefined ? obj.value = value : element.text( obj, value );
			}

			element.dispatch( obj, event );

			output = obj;
		}

		return output;
	}
645230
@Override
    public void setValue(Boolean value, boolean fireEvents) {
        boolean oldValue = getValue();
        if (value) {
            input.getElement().setAttribute("checked", "true");
        } else {
            input.getElement().removeAttribute("checked");
        }

        if (fireEvents && oldValue != value) {
            ValueChangeEvent.fire(this, getValue());
        }
    }