-
Posts
1,314 -
Joined
-
Last visited
-
Days Won
14
Everything posted by Juergen
-
No, the sending of emails is not part of the module, it is part of the ProcessWire WireMail class and has nothing to do with FrontendForms. I have only included 3 parameters (mail template, date format and time format) for sending mails and they have nothing to do with the sending process. Does print_r() output anything - this will be an important information!! Be sure that the receiver email address is written correctly, otherwise you will not get any mails!!
-
@herr rilke I have tried to submit a form inside an iframe on my localhost and it works with or without Ajax in my case. But I have to say that the form is on the same domain in this case: The form itself is located on the homepage and I have embedded it via iframe inside a childpage on the same domain. Unfortunatelly, I cannot test it on different domains. Please check if it works, if you embed the form on the same domain. Only to mention: The form, you will see in the image is another form and not the one that has been submitted (its from a new module, for creating comments based on FrontendForms).
-
Good morning @herr rilke To be honest, I have not tested the form submission inside an iframe before. If you are using an iframe, using Ajax is obsolete, because you will not get a page reload as far as I can remember (I have not used iframes for more than 10 years, so I am not 100% sure), because the form is embedded and not directly inside the code of the page. Please disable Ajax submission in this case and try it again. You can disable the Ajax on this form by using the following code: $form->setSubmitWithAjax(false); // can be true or false Let me know if it works now. Best regards
-
Hello @Flashmaster82 Your code seems to be OK. I have tested it (except the creation of the new page) and I received the mail as expected (tested on localhost with Xampp). Sometimes it will take some time, until the provider sends the mail to your inbox. You can also try the following: // replace $m->send() // with if($m->send()){ print_r('sent'); } If the mail has been sent, the print_r will be executed, so you can be for sure that the mail was sent successfully. If you do not receive anything the problem must be afterwards (fe mail configuration on your host,...)
-
Hello @Flashmaster82 Please copy this code to your template: $form = $modules->get('FrontendContact')->getForm(); // phone field $phone = new \FrontendForms\InputText('phone'); $phone->setLabel('Phone number'); $phone->setRule('numeric'); $phone->setRule('required'); // add this field after the name field $form->addAfter($phone, $form->getFormElementByName('surname')); $service = new \FrontendForms\Select('service'); $service->setLabel('Services'); $service->addOption('Service 1', 'service1'); $service->addOption('Service 2', 'service2'); $service->addOption('Service 3', 'service3'); $service->setRule('required'); $form->addBefore($service, $form->getFormElementByName('message')); echo $form->render();// Render the form I have disabled following forms in the backend configuration of this module, because they were not on your list: gender, subject and privacy. BTW, you have not written if the dropdown should be a single select or a multi-select, so I have chosen a single select. To position the custom form fields inside the form I have used the addBefore() and addAfter() method. You will find an explanation about using custom fields on GitHub. If you want to know, how you create custom fields you will find a lot of examples inside the repository of FrontendForms. Hope this helps!
-
The static method is not really the problem in this case, but the translateable functions (_(), _n()) inside the static method cause the issue as @donatas pointed out: But I need the translatable strings inside this method for the return statement, so I had to switch back to a non-static method. This was not the first problem with a Mac. I can remember at very early versions of this module, a user who uses a Mac had path problems, so he got a lot of errors that classes (or better the files) could not be found.
-
Thanks @donatas for sharing the log file with us. It contains not really useful information for me, but maybe other users can interpret the error message and what has been going on. As I can see, reverting the secondsToReadable() method from static to non-static was the safest step we could take to prevent the issue.
-
FrontendForms update 2.1.55 Bug fixed on min time configuration input field (name attribute was missing) Static function secondsToReadable() will be reverted to non-static. The static function leads to some problems under certain conditions, so the best way was to revert it back to non-static (read the discussion above). IMPORTANT: This has an impact on the FrontendLoginRegister module if you are using 2-factor-authentification, because this module uses the static function. If you are using the FrontendLoginRegister module, please update this module first (or at the same time with FrontendForms) to prevent problems. Thank you!
-
Thank you for your feedback!! That was a real struggle, but we get it ?! The only side effect is that I have to update one of my other modules (FrontendLoginRegister) too, because it uses the static method. Otherwise it will not work if 2-factor-authentification is enabled. So I have to add the same method to this module too to get it working flawlessly. To do now write the same method twice was the reason, why I have switched the method to static in the past. I will update the other module first and after that I will bump up the version of FrontendForms too. Cu
-
I have tried to find a possible cause for the problem by using a static method, but I did not find one. Maybe it will be caused by the _n() function of ProcessWire, which will be used inside this method (but this is only thought). Anyway, I have changed the method back to non-static. Could you please copy the code of the file below to your FormValidation.php FormValidation-new.php If it works for you, I will add it to GitHub and bump up the module version, so you can update the module as usual.
-
Glad that you figured it out!!! ? Usually, static methods are not others than non-static methods. The only difference is, that you do not have to instantiate a new object to be able to use it. Thats why I am a little bit confused that this may cause this error. ? I will try to find out what the problem is. I will inform you, after I have made some changes to the FormValidation.php, so that you can test it if it works.
-
What you could also try is to embed the form code directly inside the template instead of using an include. It should not have an impact, but who knows. This is what makes me thinking of that the problem should be caused by your local machine and not by the module itself. Something there (fe a specific configuration) causes this unwanted behavior.
-
I was so sure that the issue can be found in that file. ? These are the relevant files, that have been changed: Form.php FormValidation.php FrontendForms.module frontendforms.js Could you try to change the Form.php and the FrontendForms.module files to the version of 2.1.46 and leave all other files untouched. If the error persists please do the same with FormValidation.php and if necessary with the frontendforms.js, so that all 4 files are from version 2.1.46 at the end. Do not enable Captcha or Ajax. Does TracyDebugger not throw an error messages at all? What you can also do is to take a look at the browser console (Short cut F12) to take a lookt fe at the response header code (status code).
-
This is very strange! I guess the only place for a problem could the form.php file in this case, because it contains all the code for the frontend. I have studied the differences between the code from version 2.1.46 and 2.1.47 from the Form.php file, but I have not found a line, where I think it could be the cause for this issue. Here you will see the differences between the 2 versions: https://github.com/juergenweb/FrontendForms/commit/c42a410c247dd04bb296a04d8e112dc8fbb7dc4b If you have time, please change only the code of the Form.php file from the current version (or the 2.1.47) version with the one of the 2.1.46 version. Leave all other files untouched. If it works, we could be for sure that the problem is really inside the Form.php and nothing else. I have tried to change the codes and I did not run into problems (current version of FrontendForms, but Form.php was from the 2.1.46 version). form-2.1.46.php You can use your own 2.1.46 file or you copy the code from this file. Please let me know if the problem still persists.
-
I have taken a look into the changelog.md file of FrontendForms on Github and only 2 huge changes have been taken between 2.1.46 and the latest 2.1.54 version. 2.1.47: Ajax support has been added 2.1.50: New class for creating privacy text has been added All other changes are minor (but maybe could lead to problems too). I dont know, but as you have written, it only happens with the new version of FrontendForms. So the problem must be there (somewhere). First of all disable the embedding of the Javascript file. You can do this in the backend configuration inside the first tab, and see if it has an impact. I do not guess that it will solve the problem, but the Javascript file has been changed during the time too. If nothing happens, please enable the embedding of the JS file again. Next step: You are using a local machine, so could you install only for testing purposes the FrontendContact module, which is a simple contact form based on FrontendForms? It would be interesting what happens if you try to send a message with this module. You have to enter the email address where the mails should be sent to inside the module configuration and then you add the follwing code to one of your templates, where you want to output the contact form: echo $modules->get('FrontendContact')->render(); Send a message and see what happens.
-
Hello @donatas First of all, thank you for reporting this issue. Interesting! I do not have heard of this kind of error before, but Google says that this is a browser related problem and not a server problem. They say that this could be caused by browser extensions or the browser cache, but there are more issues that can be responsible for such a scenario. Could you please try to use another browser than the one that you are still using. It would be interesting if the problem persists. If the problem will be still there I can recommend you to deinstall and reinstall FrontendForms. I cannot reproduce the error and I cannot find out the cause only by the error message itself. Sometimes a fresh install helps to solve a problem. Corrected: Ok, I see you have tried this before. I guess this is not a general problem, because this is the first report of such a problem. Otherwise other users would have reported such an issue before. Best regards
-
Sorry @Flashmaster82 I guess I will not implement this on the FrontendForms module, but on the FrontendContact module. That was a misunderstanding. The FrontendForms module is only the base class for all others. If you need such a feature you can do it inside the isValid() method (creating a new page, sending mails and so on). That should not be a problem. if($form->isValid()){ // create the new page } Best regards