telephone_field_tag(name, value = nil, options = {}) public

Creates a text field of type “tel”.

Options

Supports the same options as #text_field_tag.

Examples

telephone_field_tag 'name'
# => <input id="name" name="name" type="tel" />

telephone_field_tag 'tel', '0123456789'
# => <input id="tel" name="tel" type="tel" value="0123456789" />

telephone_field_tag 'tel', nil, class: 'special_input'
# => <input class="special_input" id="tel" name="tel" type="tel" />

telephone_field_tag 'tel', '0123456789', class: 'special_input', disabled: true
# => <input disabled="disabled" class="special_input" id="tel" name="tel" type="tel" value="0123456789" />
Show source
Register or log in to add new notes.