Skip to content
● Meet Grav Guard: keep every Grav site you run secure and up to date, all from one place. Free for up to 3 sites. Read more →

How to give several labels individual classes?

form

Started by Mirko 9 years ago · 5 replies · 1119 views
9 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.

9 years ago

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

9 years ago

Yes, that is exactly what I want to do.

9 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
9 years ago

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

Suggested topics

Topic Participants Replies Views Activity
Forms & Blueprints · by TomW, 3 weeks ago
3 277 3 weeks ago
Forms & Blueprints · by Japhy, 1 month ago
2 526 1 month ago
Forms & Blueprints · by FrViPofm, 2 months ago
5 522 2 months ago
Forms & Blueprints · by Ton Haarmans, 6 years ago
13 2515 9 months ago
Forms & Blueprints · by Hugo Oliveira, 10 months ago
0 958 10 months ago