diff --git a/templates/_components/field/input.twig b/templates/_components/field/input.twig index 9bad08c9..46d56f59 100644 --- a/templates/_components/field/input.twig +++ b/templates/_components/field/input.twig @@ -3,6 +3,7 @@ Outputs a input field with the correct markup @type {include} + @param {integer} id @param {string} label @param {string} type @param {string} name @@ -13,7 +14,7 @@ @param {bool} required #} -{% set id = label is defined ? label|kebab : 'input-' ~ random(100,999) %} +{% set id = id ?? (label is defined ? label|kebab : 'input-' ~ random(100,999)) %} {% if label is defined %} {% include '_components/field/label' %} @@ -52,5 +53,5 @@ {{ placeholder is defined ? ('placeholder="' ~ placeholder ~ '"')|raw }} {{ value is defined ? ('value="' ~ value ~ '"')|raw }} {{ attributes is defined ? attributes|raw }} - {{ required is defined ? 'required' }} + {{ required is defined and required ? 'required' }} > diff --git a/templates/_components/field/label.twig b/templates/_components/field/label.twig index 7f8abd34..3397d312 100644 --- a/templates/_components/field/label.twig +++ b/templates/_components/field/label.twig @@ -15,7 +15,7 @@ diff --git a/templates/_components/field/select.twig b/templates/_components/field/select.twig index a9a6e66d..1c4a6179 100644 --- a/templates/_components/field/select.twig +++ b/templates/_components/field/select.twig @@ -3,6 +3,7 @@ Outputs a select field with the correct markup @type {include} + @param {integer} id @param {string} label @param {string} name @param {string} value @@ -13,7 +14,7 @@ @param {bool} required #} -{% set id = label is defined ? label|kebab : 'select-' ~ random(100,999) %} +{% set id = id ?? (label is defined ? label|kebab : 'select-' ~ random(100,999)) %} {% if label is defined %} {% include '_components/field/label' %} @@ -48,8 +49,8 @@ id="{{ id }}" class="{{ class }}" {{ attributes is defined ? attributes|raw }} - {{ required is defined ? 'required' }} - {{ multiple is defined ? 'multiple' }} + {{ required is defined and required ? 'required' }} + {{ multiple is defined and multiple ? 'multiple' }} > {% for option in options %} {% if placeholder is defined %} diff --git a/templates/_components/field/textarea.twig b/templates/_components/field/textarea.twig index b3814c75..ed56bab7 100644 --- a/templates/_components/field/textarea.twig +++ b/templates/_components/field/textarea.twig @@ -3,6 +3,7 @@ Outputs a textarea field with the correct markup @type {include} + @param {integer} id @param {string} label @param {string} type @param {string} name @@ -13,7 +14,7 @@ @param {bool} required #} -{% set id = label is defined ? label|kebab : 'textarea-' ~ random(100,999) %} +{% set id = id ?? (label is defined ? label|kebab : 'textarea-' ~ random(100,999)) %} {% if label is defined %} {% include '_components/field/label' %} @@ -33,6 +34,7 @@ rounded shadow leading-tight + min-h-32 placeholder-gray-500 placeholder-opacity-100 hover:border-gray-500 @@ -51,5 +53,5 @@ class="{{ class }}" {{ placeholder is defined ? ('placeholder="' ~ placeholder ~ '"')|raw }} {{ attributes is defined ? attributes|raw }} - {{ required is defined ? 'required' }} + {{ required is defined and required ? 'required' }} >{% spaceless %}{{ value is defined ? value }}{% endspaceless %} diff --git a/templates/_plugins/freeform/custom.twig b/templates/_plugins/freeform/custom.twig index 6e64b077..76645fb3 100644 --- a/templates/_plugins/freeform/custom.twig +++ b/templates/_plugins/freeform/custom.twig @@ -1,12 +1,8 @@ -{% set fieldClass = 'form__field' %} -{% set labelClass = 'form__label' %} -{% set labelRequiredClass = ' form__label--required' %} - {% set labelHidden = ['submit', 'html'] %} {% set labelAfter = ['checkbox'] %} {% if form.submittedSuccessfully %} -
+
Thank you for submitting your details, we will be in touch shortly.
{% endif %} @@ -14,7 +10,7 @@ {{ form.renderTag }} {% if form.pages|length > 1 %} -