You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

73 lines
2.4 KiB

4 years ago
  1. +++
  2. title = "Form Group"
  3. description = "Use with Label to visualize control validation states."
  4. categories = ["experience"]
  5. tags = ["form"]
  6. html_attributes = ["disabled", "form", "name", "class", "legend", "body"]
  7. custom_attributes = ["hastextarea", "state"]
  8. snippets_used = ["label", "text input", "text area", "help block"]
  9. [[copyright]]
  10. owner = "Josh Habdas"
  11. date = "2019"
  12. license = "agpl-3.0-or-later"
  13. +++
  14. [Label](../label) states with [Text Input](../text-input):
  15. ```html
  16. {{</* hackcss-formgroup >}}
  17. {{< hackcss-label for="default" text="Default:" />}}
  18. {{< hackcss-textinput id="default" >}}
  19. {{< /hackcss-formgroup */>}}
  20. {{</* hackcss-formgroup state="success" >}}
  21. {{< hackcss-label for="success" text="Success:" />}}
  22. {{< hackcss-textinput id="success" >}}
  23. {{< /hackcss-formgroup */>}}
  24. {{</* hackcss-formgroup state="warning" >}}
  25. {{< hackcss-label for="warning" text="Warning:" />}}
  26. {{< hackcss-textinput id="warning" >}}
  27. {{< /hackcss-formgroup */>}}
  28. {{</* hackcss-formgroup state="error" >}}
  29. {{< hackcss-label for="error" text="Error:" />}}
  30. {{< hackcss-textinput id="error" >}}
  31. {{< /hackcss-formgroup */>}}
  32. ```
  33. {{< hackcss-formgroup >}}
  34. {{< hackcss-label for="default" text="Default:" />}}
  35. {{< hackcss-textinput id="default" >}}
  36. {{< /hackcss-formgroup >}}
  37. {{< hackcss-formgroup state="success" >}}
  38. {{< hackcss-label for="success" text="Success:" />}}
  39. {{< hackcss-textinput id="success" >}}
  40. {{< /hackcss-formgroup >}}
  41. {{< hackcss-formgroup state="warning" >}}
  42. {{< hackcss-label for="warning" text="Warning:" />}}
  43. {{< hackcss-textinput id="warning" >}}
  44. {{< /hackcss-formgroup >}}
  45. {{< hackcss-formgroup state="error" >}}
  46. {{< hackcss-label for="error" text="Error:" />}}
  47. {{< hackcss-textinput id="error" >}}
  48. {{< /hackcss-formgroup >}}
  49. Disabling [Label](../label) and disabled [Text Area](../text-area) with [Help Block](../help-block):
  50. ```html
  51. {{</* hackcss-formgroup hastextarea="true" disabled="true" >}}
  52. {{< hackcss-helpblock >}}<strong>Sorry! Guestbook offline…</strong>{{< /hackcss-helpblock >}}
  53. {{< hackcss-label for="message" text="Message:" />}}
  54. {{< hackcss-textarea id="message" rows="10" >}}
  55. {{< /hackcss-formgroup */>}}
  56. ```
  57. {{< hackcss-formgroup hastextarea="true" disabled="true" >}}
  58. {{< hackcss-helpblock >}}<strong>Sorry! Guestbook offline…</strong>{{< /hackcss-helpblock >}}
  59. {{< hackcss-label for="message" text="Message:" />}}
  60. {{< hackcss-textarea id="message" rows="10" >}}
  61. {{< /hackcss-formgroup >}}