2022 Developer Survey is open! Take survey.

Questions tagged [form]

The tag has no usage guidance.

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

Is there a way to change the author of an entry on the frontend?

So, I know that you can do this on the backend. But is there a way to change the author of an entry from a frontend form? I'm making a vacation request system and I'm wanting managers to be able to ...
user avatar
0 votes
1 answer
64 views

fetch post request to plugin shows payload empty when sent as json stringify

When i send body: JSON.stringify(formData) to my plugin controller the payload is empty. When i send just as body: formData then the payload is there but json_decode(Craft::$app->getRequest()->...
user avatar
  • 1,886
1 vote
1 answer
36 views

Ajax form submission forbidden error on custom plugin

I am submitting form data to 3rd party api through a custom plugin using fetch. Im setting CSRF token in form like: <input type="hidden" id="subscribe-modal-token" name="{{...
user avatar
  • 1,886
2 votes
2 answers
27 views

Is there a way for a user to assign another user to a group on the frontend?

So, I'm trying to build a dashboard where the partner of the company I work for can edit users. And I want him to be able to have like a drop down to assign the user's group on the frontend. Is there ...
user avatar
2 votes
1 answer
36 views

Can I change a user field with twig without using a form?

I basically just want to set the value of a users field to a different number if something happens, so that the user field is actually updated in the CMS. Can I do that without creating a form? So ...
user avatar
1 vote
1 answer
27 views

Limit elementSelectField to specific sections

How do I limit this elementSelectField to only allow entries within a certain section? {{ forms.elementSelectField({ label: 'Blog post', name: 'blogpost', elementType: 'craft\\elements\\Entry', ...
user avatar
  • 147
0 votes
0 answers
38 views

CraftCMS + ReactJS (NextJS) send form

I build a website which has the frontend in NextJS and the backend is Craft. Everything works fine except for the emails. Does anyone have any experience on how I can send the submitted form to the ...
user avatar
  • 149
1 vote
1 answer
61 views

Post Request Required Error Solspace Freeform

I installed Solspace Freeform onto a new site and am getting this error on form submission.
user avatar
1 vote
1 answer
32 views

Multiple login forms

I have a need for 2 different login forms: customers and professionals. Each login form is slightly different in markup and heading and has different linkages to the registrations form(s) if a visitor ...
user avatar
1 vote
1 answer
44 views

How to get rules of conditional fields values on front-end, using Reasons or another solution?

I'm building a front-end form, where I'm displaying on front-end my fields following their layout within the CP: {% set section = craft.app.sections.getSectionByHandle('handle') %} {% set ...
user avatar
0 votes
0 answers
19 views

Handling CSRF errors gracefully in forms

I have a question regarding the handling of CSRF errors. By default, a CSRF error will result in a very basic / generic error screen. This is problematic for CSRF-protected forms since it interupts ...
user avatar
  • 6,040
1 vote
1 answer
48 views

Where in the world are CP form macros stored?

I'm using Sprout Reports, which makes this reference: Use the Form Macros supported by the Craft CP to keep consistent with the Craft UI. Sprout Reports will import the Craft CP Form Macros. Your ...
user avatar
  • 684
1 vote
1 answer
51 views

Filtering entires via tag field and checkbox field using a form

*** Edited the question I have a code that used to work fine on Craft 2 and I don't understand what I need to change to make it work on Craft 3. I am using form to filter through a channel of entries ...
user avatar
2 votes
1 answer
142 views

What value does actionInput provide?

What is the value in using a hidden actionInput vs an action attribute on a form? <form method="post"> {{ actionInput('path/to/controller-action') }} </form> vs <form ...
user avatar
1 vote
1 answer
29 views

I need to embed some forms into a new site

We are moving to a new Craft site and we have some forms that live on our form server. I am wanting to embed these forms into the appropriate pages. There is a PHP file that I can download that looks ...
user avatar
1 vote
2 answers
98 views

Rendering form from Entry Field

I'm trying to pass an entry field type "Formfield" into a template. I have it working without passing any custom values through but when I do it outside of the render tag, No matter what I ...
user avatar
  • 45
1 vote
1 answer
39 views

Display message on logout (flash?)

I have looked through previous questions and answers, but don't see the following clearly explained. When my users visit /logout, they are successfully logged out and redirected to the website's ...
user avatar
  • 684
2 votes
1 answer
82 views

Deleting one or all Assets from a fieldusing a front end form

Good afternoon All, Im trying to setup the ability for users to delete 1 or more of their own images from a multi photo asset field and have got stuck. This is what is have so far, I assumed adding a ...
user avatar
1 vote
1 answer
114 views

Contact form submission type in Contact Form Extensions

I have a site with three forms that use P&Ts Contact Form plugin. My client now wants the submissions to be visible in the backend and have a 'download to CSV' if possible. I was looking into the ...
user avatar
1 vote
1 answer
79 views

Why the entry-Variable doesn't exists after search?

I created a search form in my navigation and as it is described in the documentation, I created an search/results.html. And actually it works so far. Now comes the problem: The results.html extends ...
user avatar
1 vote
1 answer
171 views

Forgot Password - Success Message/Flash Message after setting new password on the login screen

Quick question about password reset (forgot a password on the front-end) So I have set my 'setPasswordSuccessPath' => 'login' so that when the new password is set, they will be taken to ...
user avatar
  • 1,824
1 vote
1 answer
162 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 ...
user avatar
  • 113
1 vote
1 answer
45 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 ...
user avatar
1 vote
1 answer
27 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 ...
user avatar
0 votes
1 answer
94 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 ...
user avatar
1 vote
1 answer
290 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?
user avatar
  • 2,023
1 vote
1 answer
57 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 ...
user avatar
  • 419
1 vote
1 answer
32 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
user avatar
  • 11
0 votes
0 answers
83 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 ...
user avatar
  • 101
1 vote
1 answer
64 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="...
user avatar
1 vote
0 answers
97 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 ...
user avatar
1 vote
1 answer
168 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 ...
user avatar
1 vote
2 answers
124 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 ...
user avatar
2 votes
1 answer
297 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.
user avatar
0 votes
1 answer
35 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 ...
user avatar
  • 368
4 votes
1 answer
652 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 ...
user avatar
  • 13.2k
1 vote
1 answer
104 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 ...
user avatar
  • 389
1 vote
1 answer
704 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?
user avatar
0 votes
0 answers
54 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/...
user avatar
  • 11
3 votes
1 answer
287 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. ...
user avatar
  • 241
0 votes
1 answer
295 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 ...
user avatar
1 vote
1 answer
89 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 ...
user avatar
1 vote
1 answer
191 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 ...
user avatar
  • 701
1 vote
2 answers
646 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 ...
user avatar
  • 836
1 vote
0 answers
127 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 ...
user avatar
  • 836
1 vote
1 answer
909 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 ...
user avatar
  • 461
2 votes
2 answers
44 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-...
user avatar
2 votes
0 answers
41 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. ...
user avatar
  • 1,218
1 vote
1 answer
2k 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" ...
user avatar
1 vote
1 answer
234 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 ...
user avatar
  • 1,218

1
2 3 4 5 6