class Kemal::Form::CheckboxField

Overview

A form field with type checkbox

Defined in:

kemal-form/fields/common.cr

Instance Method Summary

Instance methods inherited from class Kemal::Form::Field

add_error(message : String) add_error, attrs : Hash(String, String) attrs, errors : Array(String) errors, id : String id, label : Form::Label | Nil label, name : String name, required : Bool required, validate : Bool validate, validators : Array(Kemal::FormValidator::Validator) validators, value : String value, value=(value : String) value=

Constructor methods inherited from class Kemal::Form::Field

new(id : String, name : String, value : String, required : Bool, label : Nil | Kemal::Form::Label = nil, attrs : Hash(String, String) = {} of String => String, validators : Array(Kemal::FormValidator::Validator) = [] of Kemal::FormValidator::Validator) new

Instance Method Detail

def checked : Bool #

Whether the field is checked.


def checked=(checked : Bool) #

Whether the field is checked.


def to_s(io : IO) #
Description copied from class Reference

Appends a short String representation of this object which includes its class name and its object address.

class Person
  def initialize(@name : String, @age : Int32)
  end
end

Person.new("John", 32).to_s # => #<Person:0x10a199f20>

[View source]