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 remove label from form field

Solved by hughbris View solution

Started by Fubaruba 9 years ago · 4 replies · 2453 views
9 years ago

I want to have a radio field without a label, but when I remove the label from the Yaml, it displays a 0 on the website.

What should I do?

9 years ago

Since it's hard coded to accept a value, have you tried just adding spaces? If that fails, you could hide the label within the css. You can target specific labels by their for attribute like

CSS
label[for='checkbox'] { display:none; }
9 years ago Solution

This seems not to be documented: try label: false.

9 years ago

label: false did the trick 👍

9 years ago

I'll add these to my (long) list of things to investigate:

  • is label: false documented?
  • what is causing the display of 0 when label is omitted? (theme or form plugin)
  • should omitting the label property be "supported" such that it is the same as setting it false?

Suggested topics

Topic Participants Replies Views Activity
Forms & Blueprints · by Anna, 2 days ago
2 51 16 hours ago
Forms & Blueprints · by Anna, 3 days ago
7 81 16 hours ago
Forms & Blueprints · by Anna, 1 week ago
5 185 6 days ago
Forms & Blueprints · by TomW, 1 month ago
3 377 1 month ago
Forms & Blueprints · by Japhy, 2 months ago
2 593 2 months ago