TYPO3 Contact form plugin exists twice, also submitted twice - typo3

I have a submit form that is once displayed in a PopUp and once shown normal on the page. So I created it in a storage folder and used "insert record" for said plugin twice.
When I submit one of the shown forms, it will be executed twice. Anyone ever had this kind of problem?
The contact request form is selfmade.

You need to distinct your two plugins from each other. I assume you have two times the same plugin on the same page. If you submit your form, both of the plugins respond to the request, because they both feel responsible for it.
If you could give one of the plugins a different name, it would just respond to its own form, and the other plugin would not respond to the other plugins form.

try to modify your plugin so you can configure it to only show the form.then you use two different CEs: one to show only the form, the second to show the form and to handle the submit.
Other possibility: while you are handling the form store the information about handling somewhere and avoid a second handling on the same call

Related

TYPO3 perform action only once when multiple same plugins on page

I want editors to be able to insert a plugin multiple times on a page.
Under each record item on the frontpage, there are f:link.actions helpful / not helpful, which could show a comment form.
?tx_bla[question]=2&tx_bla[helpful]=0&tx_bla[action]=helpfulness&tx_bla[controller]=Question
When inserted the plugin twice on a page and clicking on the above link, the action will run twice and show 2 forms.
How can I set that actions only run for the current plugin?
I solved it by getting in the list action the current uid of the plugin
$cObj = $this->configurationManager->getContentObject();
$currentUid = $cObj->data['uid'];
assign it to the view and send as argument to the action. There compare the 2 uid's.
Every plugin listens to its GET parameter, that's why two same plugins do the same.
Either you change one plugin to not react on the GET parameter or you add a GET parameter to identify the plugin which should handle it.

Laravel 5.4 - Display errors to appended inputs in a form

Whatsup guys
I am struggling with an issue which is displaying errors on appended inputs in a form after submit. I guess there is a simple solution on this which i dont know of because i am a newbie in Laravel.
Scenario:
I have a form where a user needs to select a category and depending on the selection, a few inputs should be appended (with ajax) into the same form below the category dropdown. I have set up the validations and the error rendering on the html but it doesnt seem to work yet the request doesnt pass since it detects the validations.
Any clues?
You will not be able to display the errors next to form inputs that have been retrieved with Ajax. However, you may use an error box at the top of the screen describing the problem. Or you may simply post the form using Ajax instead of a page refresh, then using JavaScript, you can display the errors to the appended input.
If this is not an answer to the question you are asking, please provide code and more details.

Needing to have a form in every instance of a content type that can be submitted once per node - Drupal 7

So here's the situation and I cannot figure out how to accomplish it.
I have a content type called "Alert". Each instance of this content type needs to have a webform (really just a submit button with hidden fields), that users click to acknowledge they have read and understand the alert. Ideally once submitted, the form should be replaced with a message along the lines of "You have marked this alert as read."
I do have a webform created (displaying as a block to be able to place within the variant page set up for the Alert type) and can get it to appear on each instance, but users can submit multiple times on each alert (submissions are set to unlimited as if i set it to 1 submission per user, the form does not render after the first submission on any alert). Additionally, once they click on one instance of the form, every additional instance will result in a message stating they have already submitted the form.
So I really have two issues. First, and most importanlty, allow a single submission per node (without the "already submitted" notice). Second, not required but would be nice, once it has been submitted for a specific node, the form no longer renders on that node for that particular user. Anyone have any ideas on the best way to accomplish these two aspects?
I'm running on Drupal 7.56, using the AT_Panels_Everywhere theme, Webform module Version: 7.x-4.15.
In drupal 7, with webform 7.x-4.0, you can enable webforms within a content type. To do so:
Go to Structure > Content Types
[Respective content type] > Edit
In the bottom left section, find the Webforms Tab and choose Enable webforms for this content type.
Based on your use case, I'd recommend enabling that and installing the node clone module. Then you can make one alert node, setup the webform, limited to one submission per user and allow content managers to clone content. That node can serve as a template.

How to update the responses of the google form to the form itself

I am creating a Google Form. I want to insert a count in the end(anywhere,not specific) of the form which will show the number of responses submit till date.This goes like updating the live count. I have tried using script editor for Google Form Add-ons option.But I am unable to view the results automatically or changes. It asks me to accept "Terms of Service" which I don't want to do right now because I am not sure about the way it may result.
There are various options available to view the form results/responses.But here I don't want to view the results later.They should get updated when we click the submit button on form.Please note..simultaneously many users may fill the form.
To implement this,I have thought of logic like whenever submit button gets clicked..the text in the form should get updated.
Please suggest how I can add the count or apply above logic of whenever submit operation is performed. Is it possible?? Any other suggestions are welcomed..Thanks in Advance!!!
I found another possible way of doing this..I received all the responses in Google Spreadsheet..which I later embedded in my site. Solves the purpose..And the embedded data gets updated automatically for the responses !! Cheers

Submitting multiple forms from a single view

Using CakePHP I have a page where I have multiple forms. Each form updates a single field on a record. I'm trying to implement a way to submit all the forms through a single "Submit All" button. However, all my solutions so far have been lest than successful.
My first attempt was to create a separate action called editAll in the controller that took an array, but I cannot figure out how to send the data from all the forms to that action without having a hidden form that saves all that data. The second idea was to create some kind of Javascript function that iterated over all the forms to create an array to be sent to the controller's editAll action.
The first implementation did not work, and I couldn't find a reasonable way to implement the second idea.
Basically, I was hoping someone could point me in the direction to submitting multiple forms (or at least the data from multiple forms) at once from a single page.
I assume you don't ALWAYS want to submit them all - if you do, then just make one form. If you're hoping to be able to submit some of them individually, but also be able to submit them all, then you could do something along the lines of this:
Keep all the fields in one form. For each field have a 'submitted' value (1 or 0). If they click the Submit next to an individual field, turn all of the submitted values to 0 except that one, then submit the form.
If they click Submit All, then turn them all to '1' and submit the form.
Then, when you process the data, just strip anything that doesn't have 'submitted' value of 1.
It would still take some work, and you're submitting more data than is necessary, but.... it's an idea.