Skip to content
Grav 2.0 is officially stable. Read the announcement →
Archive

Handle email validation error with Forms plugin

Started by Muut Archive 11 years ago · 3 replies · 556 views
11 years ago

So, is this possible to display custom error page on Swift_RfcComplianceException with Forms or Error plugins?

11 years ago

Hi Mike, if you set the input type as email, it uses the HTML5 email field and modern browser validate this on the client-side (http://www.w3.org/TR/html-markup/input.email.html).

You can set

YAML
validate:
  rule: email

on the field and Form will validate this field server-side prior to submitting the form.

Example:

YAML

        - name: email
  label: Email
  placeholder: Enter your email address
  type: email
  validate: 
    rule: email
    required: true
10 years ago

Hi flavio,

I have the validate rule set in the form, which is otherwise working fine, but the validation does not seem to work. It throws an error instead:

TXT
Server Error

Sorry, something went terribly wrong!
0 - Address in mailbox given [faegf] does not comply with RFC 2822, 3.6.2.
For further details please review your logs/ folder, or enable displaying of errors in your system configuration.

I'm using Firefox 43, so it should be up to speed with HTML5

10 years ago

Update: Just tried in Chrome 47, same error.

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1354 9 years ago
Archive · by Muut Archive, 9 years ago
2 935 9 years ago
Archive · by Muut Archive, 9 years ago
2 4065 9 years ago
Archive · by Muut Archive, 9 years ago
1 2953 9 years ago
Archive · by Muut Archive, 9 years ago
3 1119 9 years ago