How can I add an asterisk to required contact fields?

Hello,

Using District theme -

All of the fields on my contact page are required except one. How do I add an asterisk to those field title names? (For some reason I thought this would happen automatically when I marked the field as required)

For example -

Name*


Phone*


Can you post a link to your store and password if password protected? Passwords can be located in Online Store > Preferences > Password Protection if your store is locked. I may be able to give you a javascript solution, though ideally you would do this in page.contact.liquid ( it could be called something else, but generally contact pages are using an alternate page template. )

Alternatively I can request access to your store and make the change for you if you’d like. I would still need a URL though to request access.

@Ninthony

Thank you! Your solution worked like a charm!

Hello Justaskme ,

Firstly You Go To Your ADMIN PANEL THEME And Click On Action After Click Action Go To Edit Code And Search Them contact-form.liquid Different Theme Different File So This Time You Find Contact Form Liquid Code This Code Is Like This :-

{%- form ‘contact’, id: ‘ContactForm’, class: ‘isolate’ -%}
{%- if form.posted_successfully? -%}

{% render 'icon-success' %} {{ 'templates.contact.form.post_success' | t }}

{%- elsif form.errors -%}

{% render 'icon-error' %} {{ 'templates.contact.form.error_heading' | t }}

{%- endif -%}
{{ 'templates.contact.form.name' | t }}
{{ 'templates.contact.form.email' | t }} * {%- if form.errors contains 'email' -%} {{ 'accessibility.error' | t }} {% render 'icon-error' %}{{ form.errors.translated_fields['email'] | capitalize }} {{ form.errors.messages['email'] }} {%- endif -%}
{{ 'templates.contact.form.phone' | t }}
{{- form.body -}} {{ 'templates.contact.form.comment' | t }}
{{ 'templates.contact.form.send' | t }}
{%- endform -%}

So This Is Contact Form If You Add * Follow This Step

  1. This Is Name Field :
{{ 'templates.contact.form.name' | t }}__ *__
  1. This Is Contact Field :
{{ 'templates.contact.form.phone' | t }}__ *__

Only You Can Add Span Inside The Label Tag And Run This Code Finally Solve This Problem.