Jump to content

Recommended Posts

Posted

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 

  

  • Like 2
Posted

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.

filelist.png.bdc4f0d1565dd231364fc53a128bd2af.png

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:

 

As always, please report any issues you discover here in the forum or on GitHub.

  • Like 4
  • Thanks 1
  • 3 weeks later...
Posted

Hello,

On a page with an url segment, the form is never valid. It's a simple form with an InputNumber. If I remove the segment it works, if I add it isValid() is always false.

Another minor issue, even if an InputFile has setMultiple(false), I can drag and drop several files on it, I don't know if you can do something for this.

  • Like 1
Posted
3 minutes ago, da² said:

On a page with an url segment, the form is never valid. It's a simple form with an InputNumber. If I remove the segment it works, if I add it isValid() is always false.

Reason is the option in PW admin: I always check to end segments with a slash, if I check "no" the form works.

image.png.be6015b81ba5fecb0858bd232b4bc884.png

  • Like 1
Posted (edited)

And another issue.

  1. First time I submit the form, after isValid() I call showForm(true), so the form shows with the last value entered.
    I see the notice "Thank you for your message", and the URL segment is still there.
  2. I hit submit a second time and get a 404 page (from my code) because the URL segment is removed.
Edited by da²
  • Like 1
Posted

Thanks @da² for reporting these issues. I'll look into it as soon as possible. I have to work on the weekend, so I am afraid that probably won't get around to it until next week. 

Posted

Hello @da²

I have fixed the 2 bugs with the URL segments (fixes will be in the next update), but I have a question concerning the file upload issue in single upload fields. I have tested it with Firefox without any problems. Take a look at the video.

 

In my case it works as expected. If I drag and drop more than 1 file only the last file will be taken and only 1 file will be submitted. What browser do you use? Maybe it could be a browser related issue.

Best regards Jürgen

Posted

I have found the issue: This only happens if the ID and name attribute are exactly the same on a single upload field. If there is a difference, everything works as expected, so I have added an additional suffix to the ID attribute of a file upload field to prevent this behavior.

 

Now everything should work fine! Module version is updated, so please test if everything works now as expected.

  • Like 1
Posted (edited)

Hello @Juergen,

I have an issue installing FrontendForms on my processwire instance. After installing the module, the following error appears on the very top of the admin page:

Deprecated: FrontendForms\Inputfields::removeSanitizers(): Implicitly marking parameter $sanitizer as nullable is deprecated, the explicit nullable type must be used instead in /home/web/_dev/site/modules/FrontendForms/Formelements/Inputelements/Inputfields.php on line 183

The module seems to work... but I also need to put more efforts in the forms I want to ceate and will see, if it is working as expected despite the error message.

I use FrontendForms 2.2.54 together with processwire 3.0.246 stable and PHP 8.4 on Apache webserver.

Thanks in advance for investigating.

EDIT:
it seems to work, but the frontend also displays errors in debug mode:

Deprecated: FrontendForms\Form::getLangValueOfConfigField(): Implicitly marking parameter $modulConfig as nullable is deprecated, the explicit nullable type must be used instead in /home/web/_dev/site/modules/FrontendForms/Formelements/Form.php on line 1278

Deprecated: FrontendForms\Form::newLineToArray(): Implicitly marking parameter $textarea as nullable is deprecated, the explicit nullable type must be used instead in /home/web/_dev/site/modules/FrontendForms/Formelements/Form.php on line 1448

Deprecated: FrontendForms\Inputfields::removeSanitizers(): Implicitly marking parameter $sanitizer as nullable is deprecated, the explicit nullable type must be used instead in /home/web/_dev/site/modules/FrontendForms/Formelements/Inputelements/Inputfields.php on line 183

 

Edited by Jan S.
  • Like 1
Posted

Good morning @Jan S.

Thanks for reporting these issues. I have fixed them and updated the module version to 2.2.55.

Alternatively you can replace the following files, which contain the changes:

https://github.com/juergenweb/FrontendForms/blob/main/Formelements/Form.php

https://github.com/juergenweb/FrontendForms/blob/main/Formelements/Inputelements/Inputfields.php

 

PHP 8.4. is more strict than the previous version and in addition I use

declare(strict_types=1);

on all PHP files in FrontendForms.

As a result, any warning will be treated as an error.

So please test if it works now and let me know if you discover some issues again. Thanks!!

  • Like 1
Posted

Hello @Juergen, me again and sorry for bothering you in this regards...

Adding the privacy checkbox including a standard text phrase referencing the gdpr website link works in English, but how can I display a German version of this? It is there in the translation, but I didn't figure out to get this working. I can partly achieve this by adding a custom field name holding the German text, but then the link to the referenced gdpr-page disappears.
As a workaround I just overwrote the original english text phase in /Formelements/Inputelements/Inputs/defaults/Privacy.php to get the job done. But I think there must be a more handy way to achieve this?

Another upcoming challenge would be to implement a multi-page form, where the user should shall enter form data in consecutive steps/pages, being able to go back and forth. On the last page I'd like to output all entered data to be confirmed as correct before submitting the form. Could this use case also be done using FrontendForms?

Many thanks in advance!

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...