How to hook TYPO3 Form submit - typo3

I need to hook into a TYPO3 form submit event. Do I need to write a TYPO3 Extension to achieve this?
I installed TYPO3 version 7.6.23. During the install process I picked the default 'distribution' and I now have the "TYPO3 CMS bootstrap package". When I go to the Installed Extensions screen I have the Form Extension installed (key=form).
I have a page with a form on it and I need to hook into that form submit event and do a HTTP POST to another site with some of the form data. Optionally I would like to prevent the form submit from happening, depending on the return value of my POST to the other site - so perhaps what I need in-fact is a 'before submit' event to hook.
Do I need to write an extension to achieve this? If so how can I get started? There are extension tutorials on typo3.org but they imply I need to build a full blown MVC extension, which seems way over the top for my requirements.

Due to the lack of hooks in the 7.6 form extension you have two options:
Generate a JavaScript file which listens to the submit event, prevent it and run an AJAX call to submit the data to your external site. Depending on the response you can either do a manual submit or displaying an error message.
Upgrade to TYPO3 8LTS with the new form. There you have more possibilities to hook in and do your HTTP request.

Related

Powermail broke on first click to submit

I have an error with my powermail form.
I copied one form from my site and made some little changes and now the new form doesn’t work right.
When I click on submit the form isn’t send it only “destroys” the frontend and I have to fill the fields new to submit it (then it works).
I have this warning in the console: Parsley’s pubsub module is deprecated; use the ‘on’ and ‘off’ methods on parsley instances or window.Parsley
Do you have any idea?
I’m new in the project and don’t created the first form.
Powermail: 3.22.1
TYPO3: 7.6.30
I would check if there are any redirects while form submitting. If forms are getting submitted and it seems that they are reloaded and empty, it often happens, that the form target is wrong.
E.G. If absRefPrefix is set to http:// and there is an additional .htaccess redirection from http:// to https// or so the POST params get lost and powermail shows the form again.
You can check redirects in your browser console.

Joomla Contact Form (from the ground up)

I'm looking to create a customized contact form in a Joomla 3 site I have created. I know how to write the php code for the form, but I'm unsure of where to place the code.
Ok, the form is located at http://www.theoscorner.com/contact-us. What you see there is only the design, and there is currently no script for the form to submit to. If I wanted to create a new php page for the form to submit to, what is the best method of doing this? For example:
Should I create a completely new php file where the template's index.php file sits, and use a module (instead of an article) to hold the form.
Should I create a new article page, and place my php script in that article?
Should I hard-code my form into a module, and place a php function at the end of the index.php page which gets called when the page is refreshed and the POST values are set.
I'm just looking for any type of guidance I can get right now. I don't want to use a third-party plugin, because I want a little more control than they allow. Thank you for your time.
Just use RS Forms or Contact Enhanced, they are both Joomla extensions available on extensions.joomla.org
There is no need to create your own MVC component.

What Typo3 newsletter extension can automatically fetch web content changes

The Typo3 extension tt_news enables for example all created news by this extension to be shown in the newsletter but not content from a "not news" page of the website.
We are looking for a plugin which automatically finds new content on the website and let us create a newsletter from it.
What extension could be used here? Might direct mail be able to do so?
Taken from the Direct Mail manual: "Newsletter pages are just normal pages. Their rendering is configured by the TS template."
A very simple solution for what you want to do would be to write a simple extension where you get the newest content elements and output them. Direct Mail itself will not do that for you, but it will send out any content that you provide on the "Newsletter page".

Angularjs default action form submit

My angular application needs to submit a form to a vendor. They then redirect the user to a page that I specified earlier in the process.
So I want standard, non-angular html form submit behaviour.
The documentation (details below) makes it sound like all I need to do is add an action attribute to my form element. I have tried this and it does not work.
Has anyone used this functionality in angular? Is there another step that I am missing?
The relevant section of the documentation at https://docs.angularjs.org/api/ng/directive/form is:
Submitting a form and preventing the default action
Since the role of forms in client-side Angular applications is different than in classical roundtrip apps, it is desirable for the browser not to translate the form submission into a full page reload that sends the data to the server. Instead some javascript logic should be triggered to handle the form submission in an application-specific way.
For this reason, Angular prevents the default action (form submission to the server) unless the element has an action attribute specified.
Angular does that. When you provide an action on the form, it should do exactly what you're trying to do (do a javascript thing, then submit the form).
Here is a plunk
In the plunk, you can see the $scope.submitted say 'submitted' just before the form submission kicks the page over to the submitted.html

Form (phpmailer) in joomla error

I'm having the following problem, i created a folder (named 'forms') to storage the files of phpmailer, then i have to put the action in the form this way: action="forms/mail.php".
But when i tried the form it open a not found page e in the url it appears this: "perfilo/index.php/forms/mail.php", i tried to delete the part "index.php/" and execute the script and it looks like would work without it.
Can anyone tell me how to get rid of this "index.php/" part? Am i doing something wrong or what?
Thanks
You are on the wrong track.
Search for documentation on using Joomla! Mailer.
Some resources to get you started:
JFactory/getMailer
How To Send Email from Your Joomla Extension
You are on the wrong path.
In joomla you need to implement a contact form.You can implement it like following.
Joomla Provides you a default component com_contact Any of the files from com_contact\views\contact\tmpl\ or you can create new layout with your custom design.
And you can access the files in url via wwww.domain.com/index.php?option=com_contact&view=contact&layout=default or your custom layout.
then joomla itself providing some forms if you want to customize that you can do that too.
The action they set in the form to contact controller. and sending the mail.
I got your point of view you are trying to create custom design and set it as article .
If you want to follow your own method.
You can work like this.
the form action leave as empty.
and onclick you have to set the action via jquery and then submit
Hope this may solve your issues