html_input

Table of contents

Returns an HTML input tag. The filter’s input will be the name attribute for the HTML tag. The filter accepts an extra argument which is the HTML input’s type (such as text, textarea, checkbox).

All extra arguments will be parsed as HTML attributes.

{{ "input_field_name" | html_input: "text", class: "form-textbox" }}
Input
<input type="text" name="input_field_name" class="form-textbox">
Output

Note that it might be useful to use this filter in combination with the form_input_name as follows:

{{ "Name" | form_input_name | html_input: "checkbox" }}
Input
<input type="checkbox" name="form_message[content][name]">
Output

Need help?

Do you have any question which is not answered in this knowledge base? Contact us. We are here to help you.