Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [form]

The tag has no usage guidance.

1
vote
1answer
29 views

Looking for a advances form plugin for CraftCMS

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
32 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
33 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
16 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 ...
1
vote
1answer
18 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 ...
2
votes
1answer
25 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
14 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
31 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. ...
-1
votes
0answers
20 views

Associating error messages with input fields in Contact Form

I'm using the Craft contact form. I'm trying to associate the input fields with their error messages if they're displayed. To do this, I needed to add unique ID to the UL container that contains the ...
-1
votes
0answers
23 views

Matrix block created in new entry via frontend form (Craft 2)

I'm trying to get a front-end form to create and save a matrix block. This is a completely new entry so I can't use a for loop on existing matrix blocks. The form will submit if I leave the new0 out (...
1
vote
1answer
19 views

How to handle form submissions?

So I am coming from WordPress and typically I would typically handle a post by either hooking into the wp_post action and access the $_POST request that way. Now I believe Craft is built on Yii which ...
0
votes
0answers
43 views

Front-end form for users to submit entries not working?

I've put together an entry form to allow registered users to submit content. I followed the example given in the Craft 3 Docs but it still doesn't seem to work. Was hoping someone could see what I can'...
1
vote
1answer
36 views

Login form redirect not working

My login form is not redirect like I want it to. <form method="post" accept-charset="UTF-8"> {{ csrfInput() }} <input type="hidden" name="action" value="users/login"> <input type="...
0
votes
0answers
29 views

Craft 3: Custom “Set Password Form” not working

I'm trying to make a custom page for setting a new password. I found the following in the docs: https://docs.craftcms.com/v3/dev/examples/set-password-form.html I created a file called setpassword....
1
vote
1answer
74 views

Another AJAX CSRF question

I have quite a simple registration form, something like this: <script type="text/javascript"> window.csrfTokenName = "{{ craft.config.get('csrfTokenName') }}"; window....
1
vote
1answer
49 views

Translating Craft form error message labels

I am trying to change the label for Craft's form errors. My site local is currently fr_CA, and when I try to submit a form with an error, the error message returned is in french, but the label of the ...
0
votes
0answers
20 views

Clear entry-field from front end form

I'm having trouble saving an entry from a front end form.. I have a select field with users: with options (loop over users) But I also want an empty option field above it so: <select name="fields[...
3
votes
1answer
71 views

Sprout Form redirect after submit not working correctly

All my forms on sprout form won't use the redirect they get assigned via the Form builder. Whenever a form is succesfully submited it redirects to my homepage instead of my thank-you page. <form ...
0
votes
0answers
32 views

Form in Front End Template Reference Plugin for LDAP

I am a Craft newbie, and I'm currently making a few custom templates, learning Twig, etc. My question is: in including a form in my template code, how would the form be coded (Twig or HTML)? Is there ...
1
vote
1answer
32 views

How I can capture previous and current URL to a hidden form field

I need to create a hidden form field and populate the previous and current URL can someone tell me how I can do that in Craft.
1
vote
0answers
37 views

Is the Craft Queue suitable for processing form submissions?

I am looking to queue my form submissions to be processed in the background. I want to be able to only keep user data in the system/database as long as required. This will mean keeping it to debug it ...
0
votes
0answers
35 views

Is it possible to send other fields with Form Builder 2?

I'm using Form Builder 2 on Craft 2, to send forms/emails but in my case I want to send fields/data within the "form" tag other than those who are defined in the plugin setting. Here are the fields ...
1
vote
2answers
157 views

Craft Commerce — Billing / Shipping Address validation / required Fields

As default Craft has only First Name and Last Name as required. Is it possible to set more as this two fields as required fields? And is it also possible to set custom Fields as required too?
1
vote
1answer
321 views

How to call Controller in Module?

I'm very new to craft and I'm having trouble finding an answer to my question (I've scoured the questions on here - but the only answers appear to be for plugins). Basically, I want to submit a form ...
2
votes
1answer
50 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
0answers
56 views

Front End New Entry Form

I am trying to create a form that allows users to rate a restaurant (which is another section) by creating a "userRatings" section entry. userRatings has three fields: a dropdown field called ratings, ...
0
votes
1answer
82 views

Serialization of 'Closure' is not allowed

I created a form on the frontend that allows users to upload their profile photos: <form method="post" accept-charset="UTF-8" enctype="multipart/form-data"> {{ csrfInput() }} <input ...
0
votes
0answers
25 views

AM forms file upload in form sometimes results in 0 byte file on server

I have a form (AM forms plugin) with an asset field. When the form is submitted, the file is sometimes 0 bytes on the server. The form is saved correctly and has a reference to the asset. The asset is ...
0
votes
0answers
60 views

Intermittent BAD REQEUST CSRF Token Could not be verified - Form Builder 2

I am doing normal post requests with the Form Builder 2 plugin and have run into an odd issue with CSRF tokens. I have a custom form template where I echo the call to the CSRF token in my twig ...
1
vote
1answer
73 views

How to reference an entry field in a guest user form?

I'm new to Craft. I've been trying to wrap my head around how to design the concept of Events and Event Registrations. Currently I have both Events and Event Registrations as their own Sections as ...
1
vote
1answer
80 views

Pass variable in Twig tag

My template has this line that I want to update from a field in craft: {% set form = craft.formBuilder2.getFormByHandle('schoolTrip') %} I want 'schoolTrip' to be replaceable by a plain text field ...
1
vote
0answers
48 views

Can't dynamically add value to hidden input Sprout field

I'm trying to add a hidden input with Sprout forms and Sprout fields but I can't dynamically add a value to the input attribute. I have a custom form template in craft/templates/_forms/field.html in ...
1
vote
1answer
25 views

Product category not being added to the order model. Craft Commerce

I've created a form in which to specify a category for a product on the product entry page. I can't seem to add the category that the customer selects to the order model. I've checked the orders in ...
1
vote
2answers
85 views

Sprout Form Date/Time field not displaying

I'm working on an inherited site where I have a sprout form and am adding additional fields. I have added a date/time field to the form with the settings in this screenshot. In my template where all ...
0
votes
0answers
614 views

You did not set a valid publishable key. Call Stripe.setPublishableKey() with your publishable key

I am using Charge plugin for Craft and after setting up the form I have this error below. Error: You did not set a valid publishable key. Call Stripe.setPublishableKey() with your publishable key. ...
1
vote
1answer
174 views

Missing required param: card[exp_month] on Charge 2

I created fields using Charge 2 plugin and after creating a form I getting an error Missing required param: card[exp_month]. <div class=""> <div class="grp-form"> <...
2
votes
2answers
98 views

Craft Commerce: make address phone telephone field required without JavaScript

Because I used a similar address model to the one supplied in the Craft Commerce templates, which essentially uses the same form partials for both address and billing, and also hides and shows the ...
2
votes
1answer
91 views

User Profile Form Not Saving Data

I'm having some trouble saving custom user fields via a front-end form as described here. All the other forms on the site that use the same method save the data correctly. I'm able to pull in the user ...
1
vote
1answer
35 views

Send to a friend that sends an email to a defined email of the users choosing

using the contactForm plugin, I want to make a contact form, that sends to an email address of the users choosing, not the email set up in the admin. Does anyone know the simplest way of doing this?
1
vote
1answer
31 views

How to read form response URL variables in template?

I have a basic login form that's talking to a separate server that's out of my immediate control. I'm trying to read the responses it's sending in the URL within the Craft template. For example... ...
2
votes
1answer
85 views

Address form not redirecting to payment form in Craft Commerce

I've had this working before but with the billing address as well. Do both the billing and shipping addresses need to be filled out in the same form for this to work? I get this error when I click the ...
2
votes
1answer
49 views

Using a Sprout Form within a Sprout Form?

I'm creating a website where members have a form of questions to fill in each day. But within this form is a another set of questions that are always the same each day, but will have different answers ...
1
vote
1answer
131 views

Enabling CSRF Protection for Mailchimp Subscribe plugin and other forms

I'm using the MailChimp Subscribe for Craft plugin to embed several subscription forms on a website I'm building. The following code appears via my master _layout.html file: <form action="" ...
2
votes
1answer
607 views

How do I search craft.entries with multiple parameters?

I'm filtering entries based off a searchbar with multiple parameters, and I'm building up an entries filter based off of them. Everything works great except for having more than one .search functions. ...
0
votes
1answer
135 views

Refresh Craft for loop with form parameters

Recently new to Craft and Twig although I have used Expression Engine in the past. I am looking for a way to update a for loop that is pulling entries from a defined category based on the current ...
1
vote
2answers
91 views

Additional Fields aren't sent within Contact Form email

I am using Contact Form v1.9.0 with latest version of Craft. I've additional fields to the form so that the inputted values appear in the email message. However, the only field being sent within the ...
1
vote
2answers
249 views

Generate pdf with form submission data

I'm using amforms for a client and need to create a user confirmation email that has a pdf attached containing the submitted form data, like a receipt. After a little google searching, I believe I'd ...
1
vote
1answer
42 views

Save field inputs upon submission of front end form for reuse in new form?

Is there a straightforward way of saving the input of two form fields when a form is submitted from the front end and reusing it in another form? One field is a select2 field (Users) which can ...
1
vote
2answers
110 views

front end date field format doesn't work? fields[dateField][date]

There are a number of answers on this forum for getting a front-end form to have a DateTime field that splits date and time into separate fields; It's not working for me. If I strip back to absolute ...
2
votes
1answer
106 views

Front end Entry form with validation error support?

The official example ( https://craftcms.com/docs/templating/entry-form ) seems to assume that the form itself is not already on a page which is an Entry. Dropping this form into a template that has an ...