I’ve been trying to set up this bit of code to hopefully reduce the number of unsolicited offers I receive.
My theme is bigpic
This is just cut and paste from help
- name: personality
type: radio
label: What is five times eight?
options:
alaska: 32
oklahoma: 40
california: 48
validate:
required: true
pattern: "^oklahoma$"
message: Not quite, try that math again.
No errors but the output of that code is just
32
40
48
The rest of the form is ok.
Here is the whole form, which was supplied by bigpic
title: Contact
heading: 'Say Hello.'
form:
action: /home
name: contact-form
fields:
-
name: name
label: Name
placeholder: Name
type: text
validate:
required: true
-
name: email
label: Email
placeholder: Email
type: email
validate:
required: true
-
name: message
label: Message
placeholder: Message
type: textarea
rows: 6
validate:
required: true
-
name: personality
type: radio
label: 'What is five times eight?'
options:
alaska: 32
oklahoma: 40
california: 48
validate:
required: true
pattern: ^oklahoma$
message: 'That is not correct'
buttons:
-
type: submit
value: 'Send Message'
process:
-
email:
from: '{{ config.plugins.email.from }}'
to:
- '{{ config.plugins.email.from }}'
subject: '[Contact] Message from {{ form.value.name|e }}'
body: '{% include ''forms/data.html.twig'' %}'
-
save:
fileprefix: contact-
dateformat: Ymd-His-u
extension: txt
body: '{% include ''forms/data.txt.twig'' %}'
-
display: thank-you