Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Forms & Blueprints

How to give several labels individual classes?

form

Started by Mirko 8 years ago · 5 replies · 789 views
8 years ago

Hey Guys,

i got several different labels. I was wondering if there is any possibility to give each label a individual ID. I know there are several ways to adress these labels, but i need to give them IDs particulary anyway.

8 years ago

I"m not sure I understand your questions, do you want to add an id to a form label on frontend?

8 years ago

Yes, that is exactly what I want to do.

8 years ago

Ah, then it is possible, here is an example

YAML
fields:
    - name: name
      label: Name
      id: yourownid
      placeholder: Enter your name
      autocomplete: on
      type: text
      validate:
        required: true

    - name: email
      label: Email
      id: anotherid
      placeholder: Enter your email address
      type: email
      validate:
        required: true
👍 1
8 years ago

Sorry, I was sick the last weeks. That's it. Thank you!

Suggested topics

Topic Participants Replies Views Activity
Forms & Blueprints · by Ton Haarmans, 5 years ago
13 1139 4 months ago
Forms & Blueprints · by Hugo Oliveira, 5 months ago
0 63 5 months ago
Forms & Blueprints · by Flachy Joe, 6 months ago
9 137 6 months ago
Forms & Blueprints · by Augustus, 7 months ago
7 112 7 months ago
Forms & Blueprints · by Julien, 7 months ago
10 131 7 months ago