Problem with contact form- resolved

A situation that has not been resolved on the forum although there have been proposals of ideas.

When I export the project in quick export and put it on my host, the form works. However, when I do export project with clean url activated, the form does not work as if there was something broken on the contact form.

I looked at the include folder to look at the code, everything looks ok and when inspecting the element on the browser, I see that the form is handled in JS as I read that it calls IDs, etc.

If you have found a solution to make the form work again, I would be very interested

I have contact form in the menu and contact page. Itā€™s the same

I think this may have something to do with the location of the form handler script in relation to your contact page. I think blocs assumes that your contact page is in the root of the domain - the same place where the JS folder resides. By exporting to clean URLā€™s, your contact form is in its own folder, so it has to find the form handler script a further level up the site hierarchy. I could be wrong, but I think that is most likely to be the issue. This may involve you having to open up the contact page in an html editor and adding the correct path to the form handler script in the JS folder.

1 Like

We agree thatā€™s what I thought, Iā€™m looking at it allā€¦as I have minimized html css js itā€™s quite long to read and find myself in the code. I was looking at the JS to see if all the paths are good. I noticed that using brics card designer the cleaned pages paths are not respected and I have to intervene in the code to correct all the page links used with card designerā€¦ You have to be vigilantā€¦ As soon as I find the problem with form I will post here the solutionā€¦ I sent a message to norm to warn him. Thank you for your answer, it reinforces my initial idea

The path should be near the last line of the HTML - Here is a screenshot:

I saw it last night and checked the path and everything looks good to me. All the JS are in the JSā€¦ folder All pages have access to this folder otherwise there would be no animation and I would see error codes.

For the form to work you need several JS files. The formhandler file retrieves pieces of code

Thanks for your help Hendon

1 Like

I looked at everything, changed some things and nothingā€¦I was in despair. We are on the right track Iā€™m sureā€¦

I donā€™t know if this screenshot of item inspection after trying to send through the contact form can help to solve this problem.
I looked in all the js, php files and I donā€™t see what is blocking sincerely ā€¦
If no one has a solution I will use an API to solve the problem. But itā€™s not the goal and Iā€™m sure that other people have encountered this kind of problem

Problem with Bootstrap 5 possibly?

I donā€™t think so. Analyzing the code, js handles the contact form, I checked the file paths, modified and nothingā€¦

Do you have a switch for the opt-in, my website in development has a contact form, itā€™s like the submit button does not work and it says the opt-in field is required even though the switch is enabled.

It is a simple form with a submit button and nothing else. When I did a quick export and put the site on my host, the form works except that despite my HTaccess file to remove the urls with .html as for example: https://monsite.com/about.html or when you click on the logo to return to the home page you have https://monsite.com/index.html
These problems of displaying extensions that could not be solved even by specifying it in the Htaccess file did not work, as well as the 404 file that is not declared when you type a wrong url.
On the other hand, when we export the project, these problems disappear except that the form does not work anymore. The reason? I have no idea and Iā€™ve checked and tested for several days ā€¦

If you use Clean Page URLā€™s on export, you donā€™t need anything in the htaccess to remove the .html extension do you?

Absolutely ! no need to specify the deletion of .html extensions in the htaccess

Check if your server is running PHP 8.0, if so change it to 7.4.

Sounds like a similar issue I had recently: .htaccess tweaks for security and performance - #12 by Brocky120

I was in PHP 7.3 native and I switched to PHP 8 to see if it worked and I donā€™t think itā€™s related to the PHP version. I tested PHP 7.4 and nothing

The Screenshot shows a 403 error which means access forbidden
The post request tried to call the php file and wasnā€™t allowed to
So this can be a read permission issue (chmod) on the server
Is the file readable?

Hello,
Thank you for contributing to my call for help. I had understood this forbidden access but what I donā€™t understand is where it comes from. Can the htaccess file contribute to this kind of ban?
I even deleted the htaccess file in doubt but nothing changes.

Generally as far I know this would be on the server itself
You can check in most admin panels such as cPanel the permissions (they can be number or colors or words such as 775 or red,red, green or ā€žread, read, writeā€œ etc etc)

Youā€™d want the file with the code for the Mail to be read permission

1 Like

Thank you for your information. This guided me in my research and I also searched on google as well. This is an execCGI problem. Except that despite all my changes nothing happened even when I deactivated it. So I looked for a way to display the hidden files, you never knowā€¦ and there a ā€œ.htaccessā€ I have a visible htaccess and a hidden .htaccess. There I understood. I deleted the visible htaccess file and modified the .htaccess ( which is the correct form for the server) Beginnerā€™s mistake, shame on me.
I disabled a condition in Htaccess.

secure directory by disabling script execution

#AddHandler cgi-script .php .pl .py .jsp .asp .htm .shtml .sh .cgi
#Options -ExecCGI

Maybe rewrite this condition but I am not very strong in htaccess personally

And the mail is sent perfectly but the reception of the mail when we have in the contact form a list menu, we receive by mail a position number and not the name of the list chosen.

Thanks to all of you and I hope it will help other members who will encounter this kind of problem. If anyone has a solution for receiving messages with correct information, please do not hesitate. I will search the forum if the subject has not been treated

1 Like

Hi @alpha, Iā€™m not in Blocs at the moment, but I think there are 2 parts to fill in for the dropdown list, a name and a value.
That would be my first thing to check.

Best of luck