jadwigo / simpleforms Goto Github PK
View Code? Open in Web Editor NEW[not maintained] A bolt extension to add custom forms to your site - please use Boltforms https://market.bolt.cm/view/bolt/boltforms
[not maintained] A bolt extension to add custom forms to your site - please use Boltforms https://market.bolt.cm/view/bolt/boltforms
I'm quiet new to Bolt and tried this nice extension and immediately run into trouble on my first try to output the predefined "contact" form in my template file. My development config is set up with debug_error_level 30719 and line 146 in Extension.php:
if (is_array($field['data'])) {
will crash the page, but not when changed to:
if (isset($field['data']) && is_array($field['data'])) {
With enabled E_STRICT
in PHP config file, get exception mentioned in #11. Fixing this issue and rendering demo form from extension supplied config, get the next one:
An exception has been thrown during the rendering of a template ("Undefined variable: formconfig")
This problem related to file https://github.com/jadwigo/SimpleForms/blob/master/Extension.php#L231.
Changing to $this->config[...]
instead of $formconfig
fixes the problem.
Note that mime_types_message
key should be uncommented in extension config to prevent no key notice.
When setting a redirect on ok on a form, the form disappears and an double redirect message appears. Example below.
Redirecting to
/bolt/entry/page
.
/bolt/entry/page
Here is the field options in my form i have on my config file
charges:
type: choice
expanded: true
required: true
multiple: true
label: Check all the services you would like to include in your support package:
choices: [Monthly, Per-hour, Pay As You Go, One Time Consultation]
required: true
then i tested by submitting the form with monthly and one time consultation selected and i got the email and the email listed the first option as 0 as below
charges: 0, One Time Consultation
any idea what happened?
Hi there,
I've been playing around with the 'file' field type.
It doesn't seem to save to the designated location. Tried absolute paths, relative paths, root folders, /files/ folders... nothing seems to work.
It's also not being sent over along with the e-mail.
storage_location: files/simpleforms_uploads
attach_files: true
Hope you can help.
Form content is not being stored in db if fields are left blank. Even if field is required: false .
I added value: leeg to the fields ('leeg' means empty). Some fields are filled with 'leeg' and others still 'null'.
See error below:
An exception occurred while executing 'INSERT INTO bolt_menukaartitems (slug, name, email, company, contactemail, contactphone, title, productdesc, productrequirments, productdimensions, productweight, productmaterials, productspecs, productstorage, producttransport, producttransport2, productrentperiod, productcostsperiode, productpersonnelamount, productpersonnel, productpersonnelfunction, productpersonnelcosts, upload) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)' with params ["watt-nox", "Peter", "[email protected]", "Name", "[email protected]", "0000000000", "test5", "adasdv dfv sdcx", "asfvs sdvsd c", "leeg", "leeg", null, null, "leeg", "leeg", null, "leeg", "leeg", null, null, null, "leeg", "No file uploaded"]:
SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'productmaterials' cannot be null"""
Hello!
Thanks for the extension, but I did encounter an issue. I'm trying to add Bootstrap to one of the themes I'm using and I do not see a way to add a specific class to the input controls without overriding the templates.
In the docs, the 'class' attribute is said to be used to style the form elements, but in the templates the attribute it is being used to style the container for the input control and the associated label.
Am I missing something?
Thanks,
Denis Rendler
Is it possible to use one of the field as email subject, the field can be just a drop down options or text field. right now using mail_subject: doesn't give me any options to vary email subject.
So I stumbeld upon the following weird behaviour.
Situation: I have a resource contenttype included in a template with a record.
{% setcontent form = '/resource/content-with-the-form' %}
{{ form.body }}
{{ record.body }}
In the /resource/content-with-the-form I have a field body, which is allowtwig: true
and it contains:
Some text
{{ simpleform('video') }}
Now somehow the simpleform is called twice on one post request, which results in the simpleform being sent twice, but only rendered once. Of course we only want one e-mail.
The temporary fix is to not include simpleform in a external record like this, otherwise no clue how to fix.
Paging @sbani, because he had a similar problem.
I'm using a popup modal to display the form, but after I press submit, the page refreshes and the modal containing the form will disappear. I have to open the modal again on the refreshed page to see if there were submission errors or confirmation of success. Is there a proper way in SimpleForms to implement an AJAX call to avoid the refresh?
Much thanks! :)
;-)
I don't get how I need to set a wider range for years to choose from. The documentations says it uses the same syntax as the php date values. But why does it only pick 2010-2020 when I use Y-m-d
Bolt Version: 2.2.14
SimpleForms Version 2.0
Including the simpleform
twig tag into my layout.twig
breaks all ajax calls on the page.
{"error":{"type":"Twig_Error_Syntax","message":"Unknown \"simpleform\" function in \"layout.twig\" at line 96.","file":"\/Web\/bolt\/vendor\/twig\/twig\/lib\/Twig\/ExpressionParser.php","line":573}}
Any ideas?
I didn't immediately see a way to override recipients via Twig using your extension, and ended up writing my own so I could do this:
{{ myform(form_name, to) }}
I needed to do it this way because I wanted the recipient email address to be configurable through a value in the CMS/database, and not config files.
So, is there a way to override the recipients of emails through the Twig function? If not, could something like this be easily added?
If you add class: long
in configuration of form, it will not be rendered in view, because https://github.com/jadwigo/SimpleForms/blob/master/assets/simpleforms_fields.twig#L28 line filters it out.
I have installed version 1.0 of SimpleForms with Bolt 2.1.5. I can edit the config file and make the form visible on the contact page. But the form gives an error when I want to send email (see screenshot). I haven't edit the default config file of Bolt (mailoptions). On an other Bolt install I also use SimpleForms and that works fine without mailoptions. What am I doing wrong?
SimpleForms uses a div class '.simpleform-message' as a container for messages.
Errors like 'Couldn't insert data into table bolt_xx' also should use that container (with an extra class, ie 'error').
it looks bad, and should be more informative
Hello,
How do I get radio buttons? I have this code but I keep getting a dropdown box:
cash:
label: Cash Buyer
type: choice
expanded: true
required: true
multiple: false
choices: [yes,no]
Thanks!
Hi, as composer.json sais this extension is not available with bolt.cm
Is that because some incompatibility with bolt 3.x or is it just this extension has not been updated to the new extension format?
As far as I know there is no way to send an confirmation e-mail. But there is a way to send a copy of the form to the sender of the address with use_ass and use_with. But this does not work. I get no message in my inbox that I used as the sending party of the form. I only receive an e-mail in my inbox that is set as te recipient.
contact:
mail_subject: "site | Mail"
recipient:
type: email
use_as: to_email|from_email|cc_email|bcc_email
use_with: email
recipient_email: [email protected]
recipient_name: Name
testing:
type: text
label: testing
fields:
name:
type: text
required: true
label: Naam
placeholder: Je naam ..
email:
type: email
label: E-mailadres
required: true
placeholder: Je e-mailadres ..
message:
type: textarea
label: Bericht
required: true
placeholder: Je bericht ..
button_text: Versturen
Hello, i use your sympathic extension, but there's a little deprecated use ;)
DEPRECATED]: Previous message logged using deprecated log service: extensions/vendor/bolt/simpleforms/Extension.php::783
i'm on bolt 2.2.5 (use debian)
Hello, after i hit submit, the page reloads from the top and fields are not being cleared. Did that happen to you?
Hello! Thanks for your great work, whats is the license?
The documentation seems to lack installation instructions, am I missing something?
Great extension for a great CMS.
Thank you to the developers.
I wanted to add some other html or more div tags inside the
I tried postfix an prefix options of this extension but that is not serving my purpose.
Thanks for the useful extension
I'm trying to override a global template in the config as mentioned in docs
myform:
template: _my_custom_form_template.twig
...
but the global template is always rendered. I overlooked something?
When I look at https://github.com/jadwigo/SimpleForms/blob/master/src/SimpleForms.php#L114 the $this->config['template']
is always the global template
When trying to install SimpleForms in bolt-2.0.0-beta5pl4 I get this message:
The requested extension version could not be installed. The most likely reason is that the version
requested is not compatible with this version of Bolt.
Hi,
I would like to add an option to SimpleForms to configure the constraints for every field, so that you can easily customize the default validation messages.
My idea is to do something similar to this:
fieldconstraints:
notblank:
message: Please fill in your email address
length:
min: 2
max: 100
minMessage: Your email address has to be at least {{ limit }} characters long
maxMessage: Your email address cannot be longer then {{ limit }} characters
email:
message: Please give us a valid email address
If you think this is a useful function, then I would like to add it.
Cheers
The class cannot be defined.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.