Netlify form - after submit it redirects to wrong page - forms

I've got a Gatsby.js project that is ran from Netlify. For a contact form I'm using Netlify's api.
The content is multilingual so I've got a contact page on /contact/ and /en/contact/ These obviously share the same code for a form. I've created a successful form submit page on /form-succes/ and /en/form-succes/
But when I'm on the Dutch side and I submit the form I see the url go to /form-succes for a split second, and then it goes (redirects?) to /en/form-succes
It runs well on a local env but not after build on Netlify.
Is this a Netlify issue or did I do something wrong?
This is part of the form:
var pathPrefix is, depending on the language / or /en/
<form
name={"contact"}
method="post"
netlify-honeypot="bot-field"
data-netlify="true"
lassName="contact-forms"
action={`${pathPrefix}form-succes`} // "/form-succes" or "/en/form-succes"
>
// input stuff
</form>

I've ended up makeing two Netlify Forms. One for each language. The documentation as Netlify provides is does not work.
name={'${pathPrefix}-contact'} (use backticks)

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.

What portions of the marketo code snippet can change?

My company is using marketo forms, and we are generating the page from a content management system.
We'd like to keep the contribution experience as simple as possible and prevent the user from contributing actual <script> tags.
The API documentation says they will give you a block of code that looks like this:
<script src="//app-sjqe.marketo.com/js/forms2/js/forms2.js"></script>
<form id="mktoForm_621"></form>
<script>MktoForms2.loadForm("//app-sjqe.marketo.com", "718-GIV-198", 621);</script>
My question is, what portions of this code are subject to change?
I am sure the 3 part hypen separated string and the integer being passed in can change.
What about the app-sjqe.marketo.com address?
The 3-part string is your Marketo instance ID, and shouldn't really change. The other integer is the form ID, which definitely will change depending on what form you want to embed.
The other thing that you may want to consider, is the other configurable options that you can send along with the form embed. For example, in the module that I have made for my CMS, I let the user put an optional 'thank-you' page URL, to redirect the form to after submission, and also a checkbox to optionally open the form in a lightbox on page load.
The simple module I made is for the Sitefinity CMS - happy to share code with you if that helps!

Integrating dokuwiki inside an existing site

I'd like to integrate dokuwiki as part of a Bootstrap site, within a div. Is this possible? I've tried a php include:
<?php include('dokuwiki/index.php'); ?>
but this effectively redirects - it just generates a completely new page, replacing the existing html. Note that the Bootstrap plugin doesn't do the job.
For a quick solution, it might be the time to use an HTML Frame.

PayPal Advanced hosted page inconsistency

I am integrating Payflow Advanced into our site and am testing in Sandbox. I have a page with a Pay Now button. I have all the necessary accounts, hosted pages, etc. and I successfully get secure tokens I have tried two ways of accessing my hosted page with these tokens:
1) the Pay Now button opens another HTML page in which my hosted page is specified as the source of an iframe as in
<p>This is a test of hosted pages</p>
<iframe src="https://payflowlink.paypal.com?SECURETOKEN=73nQZctvqskKbJooHoBr9DQlB&SECURETOKENID=DTesting5991376569967&MODE=TEST& BILLTOSTREET=33 Ames Road&BILLTOCITY=Groton&BILLTOSTATE=MA&BILLTOZIP=01451&BILLTOPHONE=408-110-7975" name="test_iframe" scrolling="no" width="700px" height="700px"></iframe>
When this page opens, my hosted page is in the iframe and all info is correct. After a couple of seconds, something in the PayPal code redirects the browser to the full hosted page. Everything is correct on this full page as well.
2) In this method I bypass the intermediate HTML page and use an HTML form to access PayFlow directly. The form has the ACTION set to the exact same string as the src in method 1 and a button to submit the form. as in
<form id='payment' action="https://payflowlink.paypal.com?SECURETOKEN=73nQZctvqskKbJooHoBr9DQlB& SECURETOKENID=DTesting5991376569967&MODE=TEST&BILLTOSTREET=33 Ames Road&BILLTOCITY=Groton&BILLTOSTATE=MA&BILLTOZIP=01451&BILLTOPHONE=408-110-7975">
<input display="inline" type='button' id='paypalbutton' value="Pay with Credit Card or PayPal" class='buttons' onClick="buttonclick('ccpay');">
</form>
When the form is submitted an invalid merchant message is displayed and no hosted page is displayed.
I don't care which method I use if it would only work correctly. In method 1, how do I avoid the redirection?
In Method 2, why am I getting the invalid merchant error?
Thanks
You don't have a method="POST" in your <form> tag. This causes your browser to default to using the GET method to submit the form. This, in turn, causes the browser to strip off all the query parameters from the URL, resulting in an empty request.
So, the solution to this would be to add method="POST" to your <form> tag.

Joomla module submit form can't access database

I've been searching the net for an answer to my question but I just can't seem to find one, even though it's probably pretty simple.
I have a joomla module that signs up users to a newsletter, when clicking the submit button I navigate to submitsignup.php file. I do this using the form action value like so:
form action="modules/mod_cmsnewslettersignup/otherfiles/submitsignup.php" method="post" id="subForm"
Within this submitsignup.php file I can not access any joomla classes, such as:
$db = JFactory::getDBO();
I know that I can't access any joomla classes because I made direct access to the submitsignup.php file, but I was wondering how do I access this file so that I can have access to all the Joomla classes?
Thanks.
If you are reloading the page when you submit the form, then there is a simple solution that solves both the problem of using a direct URL and of having to load the Joomla framework in that file. Basically change your module code to something like this -
if ($_POST["formsubmitted"]){
the code you run when the form is submitted
echo success or failure message
} else {
the code you run to display the form
<form action="<?php echo JURI::current(); ?>" method="post">
<input type="hidden" value="true" name="formsubmitted">
}
Basically, you submit the form to the page that displays it. Then in your module you add a hook to either process the submitted form or display the form depending on what you find in $_POST. You can add some simple security to make sure that the form is being submitted from your site.