struct DynFork::Fields::PhoneField

Overview

Field for entering Phone number.

WARNING By default is used validator Valid.phone_number?. Examples:
"4812504203260" | "+4812504203260" |
"+48 504 203 260" | "+48 (12) 504-203-260" |
"+48 (12) 504 203 260" | "+48.504.203.260" |
"+48-504-203-260" | "555.5555.555"

Defined in:

dynfork/fields/phone.cr

Constructors

Instance Method Summary

Instance methods inherited from struct DynFork::Fields::Field

choices_from_json(json : String) : Nil choices_from_json, disabled=(disabled : Bool) disabled=, disabled? : Bool disabled?, errors : Array(String) errors, errors=(errors : Array(String)) errors=, field_type : String field_type, group : UInt8 group, hide=(hide : Bool) hide=, hide? : Bool hide?, hint : String hint, id : String id, id=(id : String) id=, ignored? : Bool ignored?, label : String label, name : String name, name=(name : String) name=, slug_sources : Array(String) slug_sources, warning : Array(String) warning, warning=(warning : Array(String)) warning=

Constructor methods inherited from struct DynFork::Fields::Field

new(pull : JSON::PullParser) new

Constructor Detail

def self.new(pull : JSON::PullParser) #

[View source]
def self.new(label : String = "", default : String | Nil = nil, placeholder : String = "", regex : String | Nil = nil, regex_err_msg : String | Nil = nil, hide : Bool = false, unique : Bool = false, required : Bool = false, disabled : Bool = false, readonly : Bool = false, ignored : Bool = false, hint : String = "", warning : Array(String) = [I18n.t("formats.interpolation", samples: ("4812504203260 | +4812504203260 | " + "+48 504 203 260 | +48 (12) 504-203-260 | ") + "+48.504.203.260 | 555.5555.555")]) #

[View source]

Instance Method Detail

def default : String | Nil #

Value by default.


[View source]
def default? : String | Nil | Nil #

Value by default.


[View source]
def field_type : String #

Field type - Structure Name.


[View source]
def group : UInt8 #

To optimize field traversal in the paladins/check() method.

WARNING It is recommended not to change.


[View source]
def input_type : String | Nil #

Html tag: input type="tel".


[View source]
def input_type? : String | Nil | Nil #

Html tag: input type="tel".


[View source]
def placeholder : String #

Displays prompt text.


[View source]
def readonly=(readonly : Bool) #

Specifies that the field cannot be modified by the user.


[View source]
def readonly? : Bool #

Specifies that the field cannot be modified by the user.


[View source]
def refrash_val_str(val : String) : Nil #

[View source]
def regex : String | Nil #

Regular expression to validate the #value.

NOTE Example: "^.+$"


[View source]
def regex? : String | Nil | Nil #

Regular expression to validate the #value.

NOTE Example: "^.+$"


[View source]
def regex_err_msg : String | Nil #

Error message.

NOTE Example I18n.t(:invalid_phone)

WARNING By default is used validator Valid.phone_number?.


[View source]
def regex_err_msg? : String | Nil | Nil #

Error message.

NOTE Example I18n.t(:invalid_phone)

WARNING By default is used validator Valid.phone_number?.


[View source]
def required? : Bool #

Required field.


[View source]
def unique? : Bool #

The unique value of a field in a collection.


[View source]
def value : String | Nil #

Sets the value of an element.


def value=(value : String | Nil) #

Sets the value of an element.


[View source]
def value? : String | Nil | Nil #

Sets the value of an element.