Skip to product information
1 of 1

Artisan IT

Standard Shopify Form Fields

Standard Shopify Form Fields

 
Regular price £0.00 GBP
Regular price Sale price £0.00 GBP
Sale Coming Soon

The feature code is available for your to use free of charge. However, if you would like to show your appreciation, you can do so by 'buying me a coffee'. Thank you very much if you decide to do this for me.

Disclaimer - Buying me a coffee is a voluntary action and does not affect your access to the free code being made available for you to use. If you do 'buy me a coffee' and later decide to not use the feature code, any money sent will not be refunded.



Our standard Shopify form fields have been written to work directly in your Shopify theme customizer, without editing the theme code*.

Currently 7 form fields are available for you to use free of charge, so to get the feature code, simply select your required field, press the copy code button and then view the setup demonstration video.

* As the theme code is not being edited, any line breaks entered into the multi-line text area field will be removed. Also, the quick add to cart and buy it now buttons will require disabling otherwise form validation will not function correctly. If you wanted to retain this functionality check out our Dynamic Add to Cart service.

** The feature code has been written for and tested on the Shopify themes available Free of Charge. If the feature is being used on a premium theme, additional work may be required to align with the theme styling and form validation.

View full details

Let's take a look at the capabilities of each form field

  • All Form Fields

    • Match the styling of the default theme settings (tested on Shopify free themes not premium)
    • Display/hide the value during the checkout
    • Works with multiple languages using the Shopify Translate & Adapt app
  • Single line text input fields

    • Capture short text messages and personalisation's from a customer
    • Set a minimum and maximum number of characters permitted
    • Optional placeholder text to help a user understand what type of value you are expecting
    • Enable/disable the browser's built in spell checker
    • Restrict characters being entered with the use of a regular expression
  • Checkbox fields

    • Edit the text associated with each checkbox on the form
    • Option to make the field mandatory
    • Edit the checked value passed through with the order
    • Ability to add a hyperlink to supporting documents
  • File upload fields

    • Restrict file formats accepted
    • Assist customers by displaying accepted file formats in form field label
    • Option to make the field mandatory
    • Customisable helper text displayed when customers attempt to upload an unaccepted file type
  • Numeric input fields

    • Accepts a numeric value only
    • Option to display a metric value alongside the form field
    • Set minimum and maximum values permitted
    • Set a default value when the product page first loads
    • Control the decimal places permitted
    • Control the numeric increment when using the browser arrow controls
    • Option to make the field mandatory
    • Control the width of the form field independent of other form fields
  • Selection menu / Radio buttons

    • Enter an unlimited number of options for a customer to choose from
    • Easily change the field type from a selection (dropdown) menu to radio buttons
  • Multi-line text input fields

    • Set a minimum and maximum number of characters permitted
    • Optional placeholder text to help a user understand what type of value you are expecting
    • Enable/disable the browser's built in spell checker
    • Restrict characters being entered with the use of a regular expression
  • Colour picker fields

    • Set a default colour that is selected when the page first loads
    • Allow customers to send a precise colour with their order using a Hexadecimal, RGB or HSL value

Frequently Asked Questions

What happens after I copy the code

The feature code will be copied to the clipboard and will be available for you to paste in a custom liquid block in Shopify.

To see how to setup the code block, click to view the setup demonstration video over on our YouTube channel.

You will be able to go directly to the appropriate YouTube demonstration video, by copying the form field code to the clipboard and then pressing the 'View setup demonstration video' button.

Will I need to repeat the setup process when updating my theme to a later version

As the code snippet will be entered into a custom liquid block within your theme code, the feature should transfer to the later version of the theme automatically.

However, as we cannot control future updates released by Shopify, we cannot guarantee that this will be the case going forwards.

How do I add the form fields to the theme template

Instructional videos have been created to guide you through the setup of each type of form field. You can access the instructional setup video for each feature by first copying the code for the feature and then clicking the View Setup button.

How many form fields can I add to a product page form

Shopify allows for up to 50 blocks to be added to a section. Note this will include other form elements, such as quantity and add to cart blocks.

Can I disable form fields based on a combination of options chosen by a customer

No, in order to implement this type of control, the theme code must be updated.

We offer the Advanced Shopify Form Fields service, which will enable this functionality.

By adding a form field to a template, will the information be displayed on the packing slip and email notifications

No, additional code requires writing to the email notification and packing slips, in order to output the additional form field information.

For those of you that would like to update the code for the packing slip and email notifications yourself, check out Display additional form fields in email notifications and the packing slip.

We understand however that some people may not be comfortable editing the email notification and packing slip code, and have a service available here which allows you to request us to install the code snippets for you if you wish us to do so.

Line breaks entered by the customer are not passed through with the order when completing the multi-line text input field

When using the free feature code, any line breaks entered by the customer will not be displayed on the checkout pages. Instead the text entered will be passed through as a single line of text. This is due to a theme code update being required.

At the time of testing, line breaks are still being displayed in the order details page in Shopify and only seems to affect the checkout pages.

The Standard Shopify Form Fields - Plus service provides a solution to this problem, along with the ability to use the Buy it Now and Quick Add to Cart functionality.

The Buy it Now and Quick Add to Cart buttons allow a customer to add a product to the cart without completing the additional form fields

When using the free feature code, the Buy it Now and Direct Add to Cart buttons require disabling.

I demonstrate how to do this in each of the setup demonstration videos over on YouTube.

If you wish to enable the Buy it Now and Direct Add to Cart functionality, custom code will require writing to your theme files. This is included as part of the Standard Shopify Form Fields - Plus service.

Can the new form fields be used to modify the product price and stock levels

No, the additional product form fields are to be used to capture additional information / confirmation from a customer when ordering a product.

Any options that would affect the product price should be created using one of the standard 3 Shopify product variants.

The reason for this is because any 3rd party apps developed for Shopify will be designed to work with the 3 Shopify variants.

Will the additional fields be available to use in the Shop App and Shopify admin area when creating manual orders

No - both the Shop app and Shopify admin orders, only allow for the default 3 Shopify variant options to be selected (this is the same if an app is being used for personalisation's).

When completing manual orders you will need to ask the customer questions for the additional (non-product variant fields) and enter these options manually.

Does the code work for all Shopify themes

The code has been tested on the Shopify themes that are available Free of Charge.

It is possible the code will also work on premium Shopify themes, however, additional work may be required to ensure the form fields are styled consistently with the premium theme and function correctly.

Is support provided with the free Shopify form fields

Support is available if required when setting up your free Shopify form fields, however the support offered will not be free of charge.

If you require support, please send details using our Contact form and we will provide you with a no obligation quotation.

{% assign field_label = "Enter a unique field label" %}
{% assign required_field = false %}
{% assign position = "middle" %}
{% assign checked_value = "Yes" %}
{% assign hide_checkout = false %}

{% comment %}
Use the code below to add a link in the checkbox text

<a href='' target='_blank'>

</a>

{% endcomment %}


{% comment %} 
Do not edit the code below
{% endcomment %}

{% assign gen_id = field_label | remove: " " | strip | downcase %}

<div class="checkbox-container">
    <fieldset class="product-form__input line-item-property__field"
        data-input-type="checkbox">
        <input id="{{ gen_id }}"
            class="input-checkbox required__check {% if required_field %}required__field{% endif %}"
            form="product-form-{{ section.id }}"
            type="checkbox"
            name="properties[{% if hide_checkout %}_{% endif %}{{ field_label | strip_html }}]"
            value="{{ checked_value }}"
            data-controller-form-label="{{ field_label }}"
            {% if required_field %}required{% endif %}>
        
        <label for="{{ gen_id }}" class="form__label checkbox__label checkbox__align_{{ position }}">
            {{ field_label }}
        </label>
    </fieldset>
</div>

<style>
    .form__label {
        max-width: 37rem;
        margin-bottom: 0.6rem !important;
    }

    input[type="checkbox"] {
        cursor: pointer;    
    }
    
    .checkbox__label {
        display: inline-block;
        max-width: 85%;
    }
    
    .checkbox__align_top {
        vertical-align: top;
    }
    
    .checkbox__align_middle {
        vertical-align: middle;
    }
    
    .checkbox__align_bottom {
        vertical-align: bottom;
    }
    
    .checkbox__label > p {
        margin: 2px 0px;
    }
    
    .checkbox-container, .checkbox-container > fieldset {
        margin: 5px 0px;
    }
</style>
{% assign field_label = "Enter a unique field label" %}
{% assign default_color = "#2B6CD4" %}
{% assign hide_checkout = false %}


{% comment %} 
Do not edit the code below
{% endcomment %}

{% assign gen_id = field_label | remove: " " | strip | downcase %}

<fieldset class="js product-form__input line-item-property__field"
    data-input-type="color">

    <label for="{{ gen_id }}" class="form__label">{{ field_label }}</label>    
    
    <input id="{{ gen_id }}" 
        class=""
        form="product-form-{{ section.id }}"
        type="color"
        name="properties[{% if hide_checkout %}_{% endif %}{{ field_label }}]"
        value="{{ default_color }}"
        data-controller-form-label="{{ field_label }}">
</fieldset>

<style>
    .form__label {
        max-width: 37rem;
        margin-bottom: 0.6rem !important;
    }
</style>
{% assign field_label = "Enter a unique field label" %}
{% assign required_field = true %}
{% assign hide_checkout = false %}

{% comment %} Variables used if Shopify form field plus code has been installed {% endcomment %}

{% assign accepted_formats = ".png, .jpg, .jpeg, .psd, .webp" %}
{% assign show_file_in_lbl = false %}
{% assign help_message = "Please upload one of the following file types:" %}

{% comment %} 
Do not edit the code below
{% endcomment %}

{% assign gen_id = field_label | remove: " " | strip | downcase %}

<fieldset class="js product-form__input line-item-property__field"
    data-input-type="file">    

    <label for="{{ gen_id }}" class="form__label">{{ field_label }}{% if show_file_in_lbl %} ({{ accepted_formats }}){% endif %}</label> 
    
    <input 
        id="{{ gen_id }}"
        class="file__upload required__check {% if required_field %}required__field{% endif %}"
        type="file"
        name="properties[{% if hide_checkout %}_{% endif %}{{ field_label }}]"
        form="product-form-{{ section.id }}"
        value=""
        accept="{{ accepted_formats }}"
        data-help-msg="{{ help_message }}"
        data-controller-form-label="{{ field_label }}"
        file-input="{{ gen_id }}"
        formats="{{ accepted_formats | replace: ", ", "|" | replace: " ", "" }}"
        {% if required_field %} required {% endif %}
        >
    <p id="warn-{{ gen_id }}" class="upload__warning"></p>
</fieldset>

<style>
    .form__label {
        max-width: 37rem;
        margin-bottom: 0.6rem !important;
    }

    input[type="file"] {
        font-family: var(--font-body-family);
        font-style: var(--font-body-style);
        font-weight: var(--font-body-weight);
        font-size: 1.2rem;
        line-height: calc(1 + .6 / var(--font-body-scale));
        min-height: calc(var(--inputs-border-width) * 2);
        min-width: calc(7rem + (var(--inputs-border-width) * 2));
        margin-left: -0.15rem;
    }
      
    input[type="file"]::file-selector-button {
        font-family: var(--font-body-family);
        font-style: var(--font-body-style);
        font-weight: var(--font-body-weight);
        font-size: 1.2rem;
        line-height: calc(1 + .6 / var(--font-body-scale));
        cursor: pointer;
        margin: calc(var(--inputs-border-width) + 0.15rem);
        margin-right: calc(var(--inputs-border-width) + 0.5rem);
        padding: 0px 20px;
        height: 4rem;
        min-height: calc(var(--inputs-border-width) * 2);
        min-width: calc(7rem + (var(--inputs-border-width) * 2));
        color: rgba(var(--color-foreground),.75);
        background-color: rgb(var(--color-background));
        letter-spacing: .04rem;
        border: 0.1rem solid transparent;
        border-radius: var(--inputs-radius);
        box-shadow: 0 0 0 var(--inputs-border-width) rgba(var(--color-foreground),var(--inputs-border-opacity));
        transition: box-shadow var(--duration-short) ease;
    }
      
    input[type="file"]::file-selector-button:hover, input[type="file"]::file-selector-button:focus, input[type="file"]::file-selector-button:focus-visible{
        box-shadow: 0 0 0 calc(0.1rem + var(--inputs-border-width)) rgba(var(--color-foreground),var(--inputs-border-opacity));
        outline: 0;
        border-radius: var(--inputs-radius);
    }
</style>
{% assign field_label = 'Enter a unique field label' %}
{% assign min_characters = 0 %}
{% assign max_characters =  %}
{% assign placeholder_text = "" %}
{% assign required_field = false %}
{% assign spellchecker = true %}
{% assign hide_checkout = false %}

{% assign regular_expression = "^[^<>\\\{\\\}]*$" %}

{% assign expression_title = "The following values are not allowed < > { }" %}

{% assign validation_type = "key" %}


{% comment %} 
Do not edit the code below
{% endcomment %}

{% assign gen_id = field_label | remove: " " | strip | downcase %}

<fieldset class="product-form__input line-item-property__field text-field"
    data-input-type="textarea">

    <label for="{{ gen_id }}"  class="form__label">{{ field_label }}</label>
    
    <div class="field">
    
        <textarea id="{{ gen_id }}" 
            class="select__select text-area custom-text-input required__check {% if required_field %}required__field{% endif %}" 
            form="product-form-{{ section.id }}" 
            minlength="{{ min_characters }}" 
            {% if max_characters > 0 %}maxlength="{{ max_characters }}"{% endif %}
            placeholder="{{ placeholder_text }}"
                        name="properties[{% if hide_checkout %}_{% endif %}{{ field_label }}]" 
            {% unless regular_expression == '' %}pattern="{{ regular_expression }}"{% endunless %}
            data-controller-form-label="{{ field_label }}"
            {% if required_field %} required {% endif %}
            {% if spellchecker %}spellcheck="true"{% endif %}
            data-validation-type="{{  validation_type }}"></textarea>

        <input id="conv-{{ gen_id }}" type="text" {% unless regular_expression == '' %}pattern="{{ regular_expression }}"{% endunless %} style="display: none;">
    
    </div>
</fieldset>

<style>
    .form__label {
        max-width: 37rem;
        margin-bottom: 0.6rem !important;
    }

    .product-form__input input[type='text'] {
        cursor: text;
    }

    .text-area {
        padding-top: 1em;
        padding-bottom: 1em;
    }
</style>
{% assign field_label = "Enter a unique field label" %}
{% assign field_text = "cm" %}
{% assign min_value = 0 %}
{% assign max_value =  %}
{% assign default_value =  %}
{% assign value_increment = 1 %}
{% assign required_field = false %}
{% assign field_size = 24 %}
{% assign hide_checkout = false %}

{% comment %}
validation_key variable is only available to use when the Form field plus or advanced form field service has been purchased
{% endcomment %}

{% assign validation_type = "key" %}

{% comment %} 
Do not edit the code below
{% endcomment %}

{% assign gen_id = field_label | remove: " " | strip | downcase %}

<fieldset class="js product-form__input line-item-property__field num_field"
    data-input-type="number" >

    <label for="{{ gen_id }}" class="form__label">{{ field_label }}</label>

    <div class="field num-field">
        <input id="{{ gen_id }}"
            class="select__select custom-text-input required__check {% if required_field %}required__field{% endif %}"
            form="product-form-{{ section.id }}"
            type="number"
            min="{{ min_value }}"
            max="{{ max_value }}"
            step="{{ value_increment }}"
            value="{{ default_value }}"
            name="properties[{% if hide_checkout %}_{% endif %}{% if field_text == "" %}{{ field_label }}{% else%}{{ field_label | append: " (" | append: field_text | append: ")" | escape }}{% endif %}]"
            data-controller-form-label="{{ field_label }}"
            {% if required_field %}required{% endif %}
data-validation-type="{{  validation_type }}">
    </div>
    <p class="field_text form__label">{{ field_text }}</p>
</fieldset>

<style>
    .num-field {
        max-width: {{ field_size }}rem;
    }

    .field {
        display: inline-block;
    }

    .field_text {
        display: inline-block;
    }
</style>
{% assign field_label = "Enter a unique field label" %}
{% assign field_values = "Option A, Option B" %}
{% assign field_type = "dropdown" %}
{% assign hide_checkout = false %}

{% assign required_field = false %}
{% assign required_text = "Please select" %}

{% comment %} 
Do not edit the code below
{% endcomment %}

{% assign gen_id = field_label | remove: " " | strip | downcase %}

{%  assign selection_options = field_values | split: "," %}
{%- if field_type == 'pills' -%}
    <fieldset class="js product-form__input product-form__input--pill"
        data-input-type="radio">

        <legend class="form__label">{{ field_label }}</legend>
        
        {%  for radio-button in selection_options %}
            <input id="{{ gen_id }}-{{ forloop.index0 }}"
                class="radio-buttons"
                form="product-form-{{ section.id }}"
                type="radio"
                name="properties[{% if hide_checkout %}_{% endif %}{{ field_label }}]"
                value="{{ radio-button | strip | escape }}"
                data-controller-form-label="{{ field_label }}"
                {% if required_field %}required{% else %}{% if forloop.index0 == 0 %}checked{%  endif %}{% endif %}>

            <label for="{{ gen_id }}-{{ forloop.index0 }}">
                {{  radio-button | strip | escape }}
            </label>
        {%  endfor %}
    </fieldset>
{%  else %}
    <fieldset class="product-form__input product-form__input--dropdown"
        data-input-type="select">
        
        <label for="{{ gen_id}}" class="form__label">{{ field_label }} </label>

        <div class="select">
            <select id="{{ gen_id }}"
                class="select__select"
                form="product-form-{{ section.id }}"
                name="properties[{% if hide_checkout %}_{% endif %}{{ field_label }}]"
                data-controller-form-label="{{ field_label }}"
		        {% if required_field %}required{% endif %}>

{% if required_field %}
                    <option value="" selected disabled>{{ required_text }}</option>
                {% endif %}

                {%  for option in selection_options %}
                    <option value="{{ option | strip | escape }}" {% unless required_field %}{% if forloop.index0 == 0 %}selected{% endif %}{% endunless %}>
                        {{ option | strip | escape }}
                    </option>
                {% endfor %}
            </select>
            {% render 'icon-caret' %}
        </div>
    </fieldset>
{%  endif %}

<style>
    .product-form__input .select, .form__label {
        max-width: 37rem;
        margin-bottom: 0.6rem !important;
    }
</style>
{% assign field_label = "Enter a unique field label" %}
{% assign min_characters = 0 %}
{% assign max_characters =  %}
{% assign placeholder_text = "" %}
{% assign required_field = false %}
{% assign spellchecker = true %}
{% assign hide_checkout = false %}

{% assign regular_expression = "^[^<>\\\{\\\}]*$" %}

{% assign expression_title = "The following values are not allowed < > { }" %}

{% assign validation_type = "key" %}

{% comment %} 
Do not edit the code below
{% endcomment %}

{% assign gen_id = field_label | remove: " " | strip | downcase %}

<fieldset class="js product-form__input line-item-property__field text-field"
    data-input-type="text">

    <label for="{{ gen_id }}" class="form__label required__check">{{ field_label }}</label>

    <div class="field text-field">
        <input 
	    id="{{ gen_id }}" 
	    class="select__select custom-text-input required__check {% if required_field %}required__field{% endif %}"            
            form="product-form-{{ section.id }}" 
            type="text" 
            minlength="{{ min_characters }}" 
            {% if max_characters > 0 %}maxlength="{{ max_characters }}"{% endif %} 
            placeholder="{{ placeholder_text }}"
            name="properties[{% if hide_checkout %}_{% endif %}{{ field_label }}]" 
            value="{{ value | escape }}"
            title="{{ expression_title }}"
            {% unless regular_expression == '' %}pattern="{{ regular_expression }}"{% endunless %} 
            data-controller-form-label="{{ field_label }}"
	        {% if required_field %}required{% endif %}
            {% if spellchecker %}spellcheck="true"{% endif %}
data-validation-type="{{  validation_type }}">
    </div>
</fieldset>

<style>
    .form__label {
        max-width: 37rem;
        margin-bottom: 0.6rem !important;
    }

    .product-form__input input[type='text'] {
        cursor: text;
    }
</style>
<script>
document.getElementById("product-form-{{ section.id }}").noValidate = false;
</script>