-
Posts
1,394 -
Joined
-
Last visited
-
Days Won
17
Everything posted by Juergen
-
Version 2.2.44 includes a new feature besides some bug fixes (Thanks to @Stefanowitsch for reporting, testing and providing some fixes for the issues). New feature: File list below a file upload field Previous versions of FrontendForms have the "clear the file upload field" feature, which was a link below the input field to remove all files for upload from this file upload field. This was a nice feature to remove files from the file upload field, but @Stefanowitsch requested a better feature to remove not all, but only specific files from the field. The new feature is not just a link. Instead it provides a complete list of all added files below the file upload field and by clicking on the "X" you can remove a specific file from the field. The second advantage is that you can see all files that have been added to this field. Demo: demo-filelist.MP4 As always, please report any issues you discover here in the forum or on GitHub.
-
Hello @Stefanowitsch Thanks for reporting these issues. I have fixed them (point 1 and 2). Instead of adding the class "uk-form-label" I have added the class "uk-margin-small-right" to the label tag because I find it looks like better. I have updated the version of FrontendForms, so please update and test it. I hope it works fine, because it is very late here in Austria, but on my local installation everything looks good. I find your idea of showing the files for the upload very good, so I guess I will try to find a nice JavaScript solution to realize this. The best option would be that I will find a ready-to-use JavaScript which offers this feature, so I can include it in the next update. Thanks for giving FrontendForms a try and to make it better by reporting issues and sharing ideas to improve it with us. Best regards Jürgen
-
Ok, I found the cause for the white page: The CSRF validation is responsible for it. Fast fix: Please replace the this line inside the Form.php inside the isValid() method with this line if((strtolower($this->getAttribute('method')) === 'get') || $validation->checkCSRFAttack($this->getCSRFProtection())){ This disables the CSRF validation if GET is chosen as the method. This is only a fast fix to get it working, but I must dive a little deeper to find out why the CSRF session always returns false in this case.
-
Of course, there are several options. Which one you should use depends on your preferred output. 1) Wrap multiple inputfields inside a fieldset Take a look here for more information or here for a working example. Sometimes a fieldset is the best option to wrap some inputfields syntactically correct. 2) Wrap multiple inputfields within a div container by using the append() and prepend() methods Take a look here for more information and here is an example using this methods. If you want to wrap for example 4 inputfields inside an extra div container, the idea is to add the opening div tag via the prepend method to the fist field and the closing div tag via the append() method to the last input field. 3) Use the setMarkUp() method to add the opening and closing div I think this is the most practicable method for you if you do not want to use a fieldset. You will find more information here. Example for wrapping multiple fields between 2 div tags: $markup = new Markup(); $markup->setMarkup('<div>'); // opening div $form->add($markup); // here enter your inputfields .... .... $markup = new Markup(); $markup->setMarkup('</div>'); // closing div $form->add($markup); Best regards
-
Then try the following: if (!is_null($_SERVER['REQUEST_URI']) && strpos($_SERVER['REQUEST_URI'], $this->wire('config')->urls->admin) === 0) { Have not tried it with bootstrapping but the code inside the if condition is not important for running forms. It is only there to add CSS and JS files to the backend, so you can prevent the running of the code inside the condition by checking the existence of $_SERVER['REQUEST_URI'] first.
-
This issue has nothing to do with the module itself, but it seems that the $_SERVER array is not loaded at that moment. You can try the following: // Replace the following line inside the FrontendForms.module file on line 858 if (strpos($_SERVER['REQUEST_URI'], $this->wire('config')->urls->admin) === 0) { with this line if (!is_null($_SERVER) && strpos($_SERVER['REQUEST_URI'], $this->wire('config')->urls->admin) === 0) { Let me know if it works
-
Hello @da² You are absolutely right. The cause was a missing second parameter inside the filename sanitizer. I have fixed it now, so please download the corrected Form.php file from Github and replace it with the one on your local installation. If everything works as expected I will update the module version. So please test it and give me a feedback if everything is ok now. Best regards Jürgen
-
Here is the solution for this scenario: Instead of using only the "from" property, use the "replyTo" property too. 1) Use a sender email address that contains your domain instead of the actual sender address (for example use norply@mydomain.com, where mydomain.com is your site domain. $mail->from('noreply@mydomain.com'); 2) Add the actual sender address (for example john@gmail.com) to the replyTo property $mail->replyTo('john@gmail.com'); This will use the mail address of the actual user if you click on reply instead of "noreply@mydomain.com". I will add this to the module in the next update, so it should work on every host.
-
I have found the cause for this strange behavior: This is specific to my hoster world4you.com, but the problem could occur on other hosters too. My hoster does not allow you to send mails from domains other than the website domain itself. For example: My domain is www.mysite.eu, then I can only send mails where the email address ends with the domain name (e.g. myemail@mysite.eu). When I try to send an email from a different email domain (e.g. gmail.com), the email is not sent. I have not found the solution to disable this behavior, so I must contact my Provider. I guess this could be a security feature of the provider.
-
No, but I think there must be another cause than I have thought first. The strange thing is that I can send mails by using 2 of my modules with the WireMail class without problems on that host. Only the third module makes problems. I have solved this problem for now by using the WireMailSmtp module.
-
Hello at all I encountered a strange issue when sending emails using the Wiremail class from a shared host (world4you.com). Short description of the problem I added the following code from the documentation for the WireMail class to one of my templates for testing purposes: $m = $mail->new(); $m->to('myemailadress@example.at') // will be replaced with my real mail addy ->from('testmail@test.at') ->subject('Message Subject') ->body('Optional message body in plain text') ->bodyHTML('<html><body><p>Optional message body in HTML</p></body></html>') ->send(); After loading a page with this template, the email should be sent to my email address, but I never receive an email. If I use the same code on my local Installation with XAMPP using Gmail as my mail Client everything works as expected. So I tried to figure out where the problem might be, and I discovered the following: The WireMail class contains the send() method, which is responsible for sending the email. There you will find the PHP mail function, which contains a header variable ($header). If I remove this header variable from the brackets, the email is sent; otherwise, it is not. But the email content will not be displayed properly without this header variable. Before removing the header variable: if(@mail($to, $subject, $body, $header)) $numSent++; After: if(@mail($to, $subject, $body)) $numSent++; The problem could therefore be due to an incorrect header. So I took a look at the function renderMailHeader() which is responsible for creating the mail header syntax. I found out that the email is only sent if the value of “From” in the header is enclosed in double quotation marks, otherwise it will not be sent (see figure below). This does not seem to be important on my local installation. By default, the "From" value (in this case "myemail@example.com) is not between quotes in the header. If I change this inside the renderMailHeader() function, the mail will be sent. Only to mention: There is no entry in the log files indicating that something went wrong. Does anyone else have the same problem on a shared host and know how to fix it? I don't want to use SMTP instead, though. I guess there must be a better solution than changing something in the code or the problem is not the header syntax. Perhaps the header is not the problem, but rather the problem is related to something else?!? Thanks in advance for your help and hints
-
Hello @gloser Glad to hear that you use FrontendForms!! If you create the form by yourself as a standalone it will not work, because the $form->render() method is connected to the isValid() method. This is the place where all the magic happens. To create the desired ouptut you will need to manipulate the form markup by using some manipulations-methods. Each element of a form is an object and can be manipulated in different ways. As I can see you are using Bootstrap as your prefered CSS framework. I will try to help you to get the desired output. For this reason it would be great if you post the code of the form here in the forum or alternatively you can send me the the code via PM. Then I have a starting point where I can add the necessary manipulations. Best regards Jürgen