2022 Developer Survey is open! Take survey.
7 votes
Accepted

Unsure whether to use Sprout Forms or code forms regularly

Sprout Forms offers you a lot of the same functionality as standard Craft Entries. Both Sprout Forms and Entries allow you to create front-end forms that allow users to submit data to the database. ...
user avatar
  • 13.2k
6 votes
Accepted

How do I extend another plugin?

I believe what you asking about are Hooks and Events. Craft has several of them listed in the Hooks Reference and Events Reference. And Craft also allows us to add Hooks and Events in our plugins, ...
user avatar
  • 13.2k
6 votes

Looking for an advanced form plugin for Craft CMS

To answer your questions in regards to how they will fit with Freeform... If what you mean by pre-populating fields with existing data is being able to fill fields with data from other elements, ...
user avatar
  • 1,390
5 votes

Error when submitting Date Field from the front-end: cannot be blank

The input tag presented in the comments above does not appear to use the correct input tag format for the date field. To submit a date field on the front-end, your input fields need to be setup with ...
user avatar
  • 13.2k
5 votes

Ajax submissions using SproutForms

I figured it out (edited with my FORM mark-up as well): I'm actually rendering the FORM using the SproutForms method: <div class="submit-via-ajax"> {{ craft.sproutForms.displayForm(block....
user avatar
4 votes
Accepted

Is it possible to use something like dropzone.js for file uploads with sprout forms?

You will have to upload the files and index them as assets, then return the asset id's to your form. You can then use these asset id's in your form so you can post them to the server, effectively ...
user avatar
4 votes
Accepted

Why would an if statement insist on printing a value?

Wow Matt, awful question! You should probably have a moderator remove it so nobody else has to suffer. In SproutForms_HtmlDisplay, change the __call() function's echo... public function __call($key, ...
user avatar
  • 3,901
4 votes

Sprout Forms: Localized version of form with translated labels?

Currently, Sprout Forms (v1.1.0) is translatable, but we have not yet added support for Craft's localization feature. You can find a template of a translation file on our Github Account. We want to ...
user avatar
  • 13.2k
4 votes

Sprout Form Not Saving Entries

Re-installing the Sprout Invisible Captcha plugin and including the following line before the closing tag got it working: {{ craft.sproutInvisibleCaptcha.protect() }}
user avatar
4 votes
Accepted

Filter Sprout Forms entries based on field value, using parameters

Filtering entries is now possible as of Sprout Forms v2.2.0: {% for formEntry in craft.sproutForms.entries.formHandle('contact').firstName('Zoe') %} ... {% endfor %#}
user avatar
  • 13.2k
4 votes

Sprout Forms `onSaveEntry` event

Adding an event handler is not something you do through the control panel. What you need to do is create a plugin (pluginfactory.io makes this fairly easy), and in your plugin's main class, you have ...
user avatar
4 votes
Accepted

Customize the field.html file for Sprout Forms

To override field.html you will also have to provide an override for tab.html and errors.html. The field.html template is a bit more complex and the Twig code to get it to work depends on a few ...
user avatar
  • 13.2k
3 votes

Sprout Forms issue: form not submitting

Probably you are caching the page. You can't cache a sprout form. The csrf will be the same for all the users.
user avatar
3 votes
Accepted

Sprout Forms: gather data from the page a form is on

You're understanding the purpose of the Hidden and Invisible fields correctly and your desired workflow is possible. Let's step through each part: Hidden and Invisible Fields These fields allow you ...
user avatar
  • 13.2k
3 votes

How can I get a restricted Asset Allowed File Type upload to accept RTF files

Does this help you? It'll let you add additional file extensions that are allowed to be uploaded. http://buildwithcraft.com/docs/config-settings#allowedFileExtensions
user avatar
  • 566
3 votes
Accepted

Creating forms that save to the database & can be viewed in the admin

For now, you can create forms and create entries through the plugin Guest Entries. In Guest Entries, entries are disabled by default. Sprout also has a plugin for creating forms, that is currently ...
user avatar
  • 2,947
3 votes

URL validation without http:// or https:// in the URL

To conditionally add http:// to strings that don't begin with http:// or https://, use the Twig matches operator in a comparison. To keep the syntax compact, I use a ternary operator within the set ...
user avatar
  • 35.8k
3 votes

How do I extend another plugin?

There are two ways you could get something like this to work: If the other plugin fires an event when at a point in the code where your plugin wants to do something, you can just listen for that. (...
user avatar
3 votes

Sprout Forms - An unknown error occurred when trying to view entries in CP

You're experiencing two different things. First, as Johannes suggested, if you update to the latest version of the plugin (using the same url that you were sent for the private beta), the error in ...
user avatar
  • 13.2k
3 votes
Accepted

How can I send email notification to different addresses using Sprout Forms

This can be done with Sprout Forms and the Sprout Fields Email Select Field. The Email Select field allows you to create a dropdown list of email addresses, hides those email addresses on the front-...
user avatar
  • 13.2k
3 votes
Accepted

Where can you set a form field to required in the DB

In Craft, fields can be shared across field layouts and there's no way to set a field as required across the board. A field can only be declared as "required" in the context of a field layout. ...
user avatar
3 votes

How can I output a specific field in Sprout Forms email notifications?

Turns out, there's an element twig variable that I can use (it contains the Sprout Form entry), so I can output: {{ element.first_name }} for instance.
user avatar
  • 111
3 votes
Accepted

Sprout Email compiled_templates

You can delete that folder entirely and it will get re-created on the next request that needs a template. If it's not updating, chances are you've got some PHP byte-level caching extension installed ...
user avatar
  • 66.4k
3 votes
Accepted

Write into Sprout Forms from another plugin

When leveraging another plugin programmatically, you will typically want to use the service layer. In your case, the SproutForms_EntriesService.php is where the saveEntry action gets processed. The ...
user avatar
  • 13.2k
3 votes
Accepted

Best way to delete submitted data in Sprout Forms?

Click the checkbox at the top to select all of them.
user avatar
  • 3,195
3 votes

How to insert a Sprout Form into a new page in Craft CMS

If you don't have a local development environment setup, you will need FTP access to the server where Craft is installed to edit templates. The one line of code cannot be copied and pasted into a ...
user avatar
3 votes
Accepted

How can I make Sprout Invisible Captcha plugin works using AJAX submission?

Based on your code - and our comments - you need something like this: <form id="someFormId"> <input type="hidden" name="action" value="sproutForms/entries/saveEntry"> <input ...
user avatar
3 votes
Accepted

Using Dynamic values in the Reply To field in Sprout Forms Notifications

Ran into the same issue, asked the support team, and they confirmed it's a bug. Workaround is to comment out this line: https://github.com/barrelstrength/craft-sprout-base/blob/v2/src/app/email/...
user avatar
  • 177
3 votes

Looking for an advanced form plugin for Craft CMS

I work with Sprout and can answer your questions with regards to Sprout Forms. 1. It should be possible to prepopulate fields with existing data This will happen by default in a lot of standard use ...
user avatar
  • 13.2k
3 votes
Accepted

Sprout reports timing out on thousands of records

As you suspected, Sprout Reports is not designed to handle large quantities of data if it's more than your server can handle. As for how many records you could export, it really just depends on how ...
user avatar
  • 13.2k

Only top scored, non community-wiki answers of a minimum length are eligible