bolt / bolt/boltforms

result.pass('email') is always false before and after form submission

Open
#223 2 comments 0 reactions 1 assignee Claimed by @rossriley View on GitHub
Dominant language
PHP
Stars
52
Forks
54
PR merge metrics
No merged PRs in 30d

Description

Hi! I don't know if this is a bug or that I might be doing things wrong, but after I submit a form I get the feedback success message together with the form which I didn't expect.

Details
-------
- Relevant BoltForms Version: 4.1.14
- Relevant Bolt Version: 3.4
- Install type: Composer install
- PHP version: 5.6
- Used web server: Apache

Reproduction
------------

I have installed BoltForms 4.1.14 and I'm using the default BoltForms templates and the default contact form in `boltforms.bolt.yml`.

To reproduce the issue fill in the form and submit. After submitting the form if the submission is successful the expected result would be to see the info messages and no form anymore.

In this line https://github.com/bolt/boltforms/blob/99199b0e58557bb43160f73549b32d8cfb5d33ec/templates/form/form.twig#L38 it seems that result.pass('email') is not returning true when a form is submitted successfuly.

Is this a bug or is there a workaround for this?

Thanks!

**Not submitted form screenshot:**
![notsubmittedform](https://user-images.githubusercontent.com/6607455/33994072-6138122e-e0d9-11e7-97f3-6aeb152780df.png)
**Submitted form screenshot:**
![submittedform](https://user-images.githubusercontent.com/6607455/33994079-6a102120-e0d9-11e7-8422-bc289f79ae9c.png)

**My `boltforms.bolt.yml` for that form:**
```
contact:
submission:
ajax: false # Use AJAX for form submission and handling
notification:
enabled: true
debug: false
debug_address: myemail@myemail.nl # Email address used when debug mode is enabled
debug_smtp: true
subject: Your message was submitted
from_name: name # Email addresses and names can be either the
from_email: email # name of a field below or valid text.
replyto_email: email #
replyto_name: name # NOTE: Email addresses must be valid
to_name: My Site #
to_email: myemail@myemail.nl #
feedback:
success: Message submission successful
error: There are errors in the form, please fix before trying to resubmit
fields:
name:
type: text
options:
required: true
label: Name
attr:
placeholder: Your name...
constraints: [ NotBlank, { Length: { 'min': 3, 'max': 128 } } ]
email:
type: email
options:
required: true
label: Email address
attr:
placeholder: Your email...
constraints: [ NotBlank, Email ]
message:
type: textarea
options:
required: true
label: Your message
attr:
placeholder: Your message...
class: myclass
needreply:
type: choice
options:
required: false
label: Do you want us to contact you back?
choices: { 'Yes': 'yes', 'No': 'no' }
expanded: true
multiple: false
submit:
type: submit
options:
label: Submit my message »
attr:
class: button primary
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.