Questions tagged [form]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
1answer
22 views

Missing field validation on user account edit

I've been implementing a user account page with Craft Commerce and copied over the template found here: https://docs.craftcms.com/v3/dev/examples/user-profile-form.html#simple-profile The issue is ...
1
vote
1answer
28 views

How to relate a long survey to a user and later query by values

I'm working on a new project that requires users to fill out a lengthy survey to assess their skills. These skills will then be used to query for users with a front-end interface. My question has to ...
5
votes
2answers
2k views

How do I enable redactor rich text editor in a front-end form?

I have a front-end form for registered users to submit entries, however I'd like to have a WYSIWYG editor like the dashboard. How would I get redactor working with this form? My form: <form ...
2
votes
1answer
141 views

Add Dynamic Elements In Forms

I'm needing to add a dynamically added dropdown input field for my form, as is commonly done with javascript. How would this be possible? In other words, there may be more than 1 dropdown desired by ...
1
vote
1answer
15 views

Building my first Sprout Form and need ability to add Tags input

I'm building my first Sprout Form and I need a tags relational field, but where the user filling in the form can add their own tags, but if similar/matching tags exist then they can select them, like ...
0
votes
0answers
18 views

Integrate Mailchimp subscribe form in twig template

I try to embed a Mailchimp subscribe form in a twig template via: <form action="https://my-company.us5.list-manage.com/subscribe/post?u=293f" method="post" name="mc-embedded-subscribe-form" class="...
1
vote
1answer
58 views

Can the Freeform Plugin be used with headless mode in Craft?

Anyone know if the Freeform plugin is compatible with Craft's headless state. Or if there are any other form plugins that are?
0
votes
1answer
23 views

How to save data from a form in Craft? Explain with an example?

where do you handle the POST requests? where do you write the validation rules and flash error messages? where do you write save to db code? (mainly i want to know how do you route a POST request to a ...
1
vote
1answer
28 views

Avoid saving $_POST in Craft logs for certain URLs

We know that Craft logs the $_POST variable in web.log. I wonder if we have some sensitive data going through the server side (collected from a front end form), even if we don't save it in the ...
1
vote
1answer
23 views

Is it possible for photo's to be uploaded to a form?

I would like to create a form for competition entries. However, there needs to be the option for entrants to upload pictures with their entry form, is this possible? Many thanks
1
vote
1answer
33 views

Limiting form entries per day in FreeForm

I am using freeform to manage forms on my site. I'd like to limit the number of entries on a form to 200 per day. The method I thought would be best is to get the submissions for the form, and use ...
0
votes
0answers
32 views

Frontend Form for editing entries HTTP Exception

I took the example form of the craft CMS Entry Form Documentation page and tried to use it on a test site. However i always get a HttpException after submitting the Frontend Form. Here's the Stack ...
1
vote
1answer
24 views

Error 'form[fieldName] : <fieldName> is invalid' while submitting multiple checkboxes

I have a form with multiple checkboxes in it. However, when submitting the form it returns an error like this: {"success":false,"errors":{"formDate":["Date is invalid."]}} template: <input type="...
1
vote
1answer
50 views

Frontend form validation

I need to validate the form submitted at the frontend by applying additional validation rules. For that I have created the plugin that listens to "EVENT_BEFORE_SAVE_ENTRY" event and should validate ...
1
vote
0answers
31 views

Sanitize form input

I'm trying to sanitize form input values in my plugin. Yii2 framework provides the following validation method: https://www.yiiframework.com/doc/guide/2.0/en/tutorial-core-validators#filter It says ...
0
votes
0answers
24 views

FreeForm inline validation

I am using Freeform to handle the forms on my site. The plugin page shows the supplied demo can handle inline validation along with custom messages, but I can't seem to get this setup/see where you ...
5
votes
2answers
442 views

Looking for an advanced form plugin for Craft CMS

I'm currently using amforms from a&m impact on a couple of sites. However, it looks like this plugin won't get a craftcms version 3 update. In addition, my requirements for a form plugin have ...
1
vote
1answer
317 views

How save data from form in headless Craft via Vue.js

I have front-end form on Vue.js and Craft CMS for the backend. I need form. And I want to save data from the form in Craft CMS. How to save data from user frontend to backend on Craft CMS?
0
votes
0answers
64 views

Notification Plugin - Internal Server Error

Have tried a couple different plugins to generate a simple email notification when someone submits a Guest Form. "Guest Entries Notification" didn't do anything. It didn't display errors or send an ...
0
votes
0answers
13 views

Craft Guest Form Category, Date Not Saving

The examples are not working for me. The category value via the Guest Form plugin is not saving: <select name="fields[adCategory][]" id="adCategory"> <option value="">-- Category --&...
0
votes
0answers
9 views

Craft 3 Matrix Field customFields property 'required' and 'sortOrder' fields null

I'm trying to dynamically build a frontend form based on a Matrix field. I'm iterating over the entry.aMatrixField.customFields array which returns me an array of field objects in Twig. The field ...
2
votes
1answer
139 views

How to build contact form from scratch (no plugin)

I want to build a simple contact form without plugin, i am new to craft cms coming from wordpress, how can i build a simple form that will be save on entries and will send an email.
0
votes
1answer
31 views

Form fields not visible after creating content fields using A&M Forms plugin

I'm new to Craft 2, and I created about 20 new form fields in the Settings>Content>Fields section. I created a new group for them to go in. Then, I went to create a new Form, but I cannot see those ...
3
votes
1answer
321 views

What are the different scenarios to plan for when using $allowAnonymous in a controller?

Craft 3.2 updates how the allowAnonymous behavior works. I have things working in our plugins but I don't understand the different syntaxes needed across our different allowAnonymous use cases. For ...
1
vote
1answer
56 views

Get radio button's value from a form by PHP

I have been developing validations for my form. It is possible to get text input's value like; $password = Craft::$app->request->getBodyParam('password'); However, this function seems not to ...
0
votes
0answers
32 views

Add Matrix Blocks to existing Entry with Form without discarding existing Matrix Blocks

When I want to save an new Matrix block with an form to an existing Entry: <form method="post" accept-charset="UTF-8"> {{ csrfInput() }} <input type="hidden" name="action" value="entries/...
2
votes
2answers
766 views

Update form entry using the Guest Entries plugin

I am trying to create a form that anyone can submit regardless if they are logged in or not. I found the Pixel & Tonic Guest Entries plugin for this. Now that I've installed and configured the ...
1
vote
1answer
57 views

Email template issue

I'm using Rias500/craft-contact-form-extensions plugin for creating custom email confirmation templates, and it works great but when I try to override the template (because I need confirmation emails ...
3
votes
1answer
115 views

How to re-populate form with old values when submitted from a controller?

I have a form in a template which makes a request to the specified action (a controller). The controller decides that there is an issue with the inputs and needs to provide error output for the user. ...
0
votes
1answer
162 views

Trying to show selected categories in a multi select form input

I have a users form, which they can select their occupations. They can choose multiple values from a multi-select input. Occupations are categories that are related to users profile. Here in this ...
2
votes
1answer
408 views

Upload an asset in a custom form

I am trying to upload/add an asset to an entry via a form on the website. The entry saves fine when I don't include the asset field but as soon as I add the asset field and try to upload a file I get ...
1
vote
1answer
108 views

Entry form with field translated accross multiple sites

I've got 2 sites, each with a locale (dutch - nl & french - fr). I've set up a frontend entry form that works nicely for all not translated fields, I am however struggling to get it to accept ...
1
vote
2answers
754 views

Editing entry in front-end

I am trying to edit an entry automatically when you press a button. Is there a way to do this? A bit more detail: I have listed up a few entries, each with their own button. When I press the button ...
1
vote
1answer
402 views

How to validate a form request

Is there anything with craft like Laravel's Form Requests? I am writing a plugin with a custom entry type. Right now, I am doing the store/edit pages and I do not want to reinvent the wheel ;) Is ...
1
vote
2answers
389 views

Convert checkbox values from an array to a string

I have a front end form with multiple checkboxes. Is it possible to convert the checkbox values from an array to a string before it's submitted to the database? I want to save the checkbox values ...
10
votes
1answer
2k views

How do you delete assets from a frontend form?

I am creating a proof of concept for a client in Craft where the client's customers can manage projects from the frontend of a Craft install. I have a frontend form working correctly for creating a ...
1
vote
0answers
92 views

Craft 3: Possible to merge checkbox and text values from a frontend form and put into a plaintext Craft field?

Is it possible to submit checkbox array and text values on a front end form into a plaintext Craft field in Craft 3? My solution worked in Craft 2 but it broke in Craft 3 due to some under the hood ...
2
votes
2answers
27 views

How to process POST and entry fields when using same form for Add as Edit on front end?

I use the same form for adding an entry on the front end as I do for editing it. So when editing it, we need to insert the field values in the fields. When editing or adding it we also need to re-...
2
votes
0answers
24 views

Asset Upload Form Field Error States

I currently have an asset upload field, but I'm trying to make it call errors back if the image isn't an extension that's set within the field, allowing users to understand why the form didn't save. ...
1
vote
1answer
820 views

Craft 3 Registration Form Success Redirect

Is it possible to redirect the user to a specific page after they successfully complete the front-end registration form (before activation)? I've tried adding: <input type="hidden" name="action" ...
1
vote
1answer
141 views

Front End Entry Form Select Dropdown Error

My front-end new entry form works, but when I add the complexity of a dropdown to the mix - it error's and doesn't save the entry. (I found this out with trial and error, removing fields until I found ...
1
vote
1answer
241 views

AJAX CSRF Producing Inconsistent Results

I am using CSRF tokens in a form on CraftCMS. Submissions are successful with a standard configuration. Introducing "fresh" CSRF tokens via AJAX on page load is causing some trouble. This is ...
1
vote
1answer
958 views

Craft Commerce 2 Ajax Add to Cart

Trying to ajax add to cart but each submit returns a https://www.website.com/commerce/cart/updateCart 404 (Not Found) I have this in my twig template: {% for book in craft.products().type('books')....
1
vote
0answers
91 views

How can I create a Module/Plugin to edit multiple entries via a single front-end form in Craft 3?

Scenario: I have a Structure section called Competitions that allows users to submit one or more (usually three maximum) entries to judged photo competitions. However, they can only submit one or two ...
1
vote
0answers
112 views

Error message regarding password in user registration form

I have a custom registration form in my Craft site based on this info. https://docs.craftcms.com/v2/templating/user-registration-form.html And I want to show error message when the password doesn't ...
2
votes
1answer
111 views

How Do You Add A Form on a Page to Gate the Content?

I am new to Craft, but one of my clients has a website built in Craft. They would like to "gate" the content on a page of their website. A. Is it possible to gate content in the Craft CMS? Client ...
1
vote
1answer
97 views

hashing form fields to prevent tampering

I have a front end form for entry creation. I have a few options I don't want tampered with. The docs for |hash say "Prefixes the given string with a keyed-hash message authentication code (HMAC), for ...
1
vote
1answer
61 views

User Account Form Dropdown

I have a Countries dropdown menu for signing up that i didn't have before. It used to just be a text field where they can input their own country. It works on the front end sign up form properly, but ...
1
vote
2answers
52 views

Create web report able to be exported in pdf

I'm new in the Craft CMS world, and I'm approaching it because I need to create a web app where I and my colleague can create reports based on what we do for customers and export them in PDF format. ...
2
votes
1answer
240 views

How can I get a user to choose in which group he registers using the User Registration Form

Is there a way to allow a registrant to choose a user group in the registration form? I tried using the following code but it didn't work: <input type="hidden" name="userGroups" value="3">

1
2 3 4 5 6