Jump to content

Juergen

Members
  • Posts

    1,427
  • Joined

  • Last visited

  • Days Won

    18

Everything posted by Juergen

  1. Version 2.1.38: This version now supports HTML5 validation for the 4 new validators added in 2.1.37 by using Javascript. It works by adding min and/or max attribute on the fly to the appropriate input field, if a value has been changed inside the reference field. Please read the full changelog here for more detailed information.
  2. Hello @Andy Please update to FrontendForms 2.1.37 I have added 4 new validation rules for dates: dateBeforeField validator: Checks if a date is before a date entered in another field inside the form dateAfterField validator: Checks if a date is after a date entered in another field inside the form dateWithinDaysRange validator: Checks if a date is within a given time range in days depending on a date entered inside another field inside the form. Fe date must be in a time range of 7 days in the future starting from a date entered inside another form field. Example of time range: start date: 2023-05-15, timerange: 2023-05-15 - 2023-05-22. Value must be inside this time range. Supports a positive (future) and negative (past) days value. dateOutsideOfDaysRange validator: Checks if a date is outside a given time range in days depending on a date entered inside another field inside the form. Fe date must after the end of a time range of 7 days starting from a date entered inside another form field. Example of time range: start date: 2023-05-15, forbidden timerange: 2023-05-15 - 2023-05-22. Value must be outside this time range -> after 2023-05-22. Supports a positive (future) and negative (past) days value. You will find the explanations on how to use here: https://github.com/juergenweb/FrontendForms/tree/main#datebeforefield The complete examples on how to use them on inputfields can be found inside the examples folder: https://github.com/juergenweb/FrontendForms/blob/main/Examples/field-validation.php#L221 This is full PHP validation - no JS or JQuery. Just to mention: HTML 5 validation does not work for these validation rules. HTML5 validation have to implemented via JS - maybe I will add this in the future, but not for now. Just take a look if this solves your problem. Best regards
  3. Hello @Andy Thanks for your input on date fields. To be honest, I have not focused on date fields, because I did not use them a lot, but you have inspired me to enhance them. At the moment, only these 4 date validations can be performed: date - Field is a valid date dateFormat - Field is a valid date in the given format dateBefore - Field is a valid date and is before the given date dateAfter - Field is a valid date and is after the given date You will find examples of these validations at https://github.com/juergenweb/FrontendForms/blob/main/Examples/field-validation.php#L210 I will take a look of what can be implemented of your suggestions. To sum it up once more.: You will need to set a time range on a date field, where dates in between are allowed, others are forbidden You will need a validator, that checks if the date entered in a second date field, is inside a specific time range depending on the date entered inside the first field To the first point, I guess I can write a new method, so you will be able to set the range ( fe $field->setRange('15-05-23', '15-06-23')) or something like this, where first parameter ist the start and the second parameter, the end point of the time range. To the first point: you can set a time range with dateBefore and dateAfter validators: $inputDate = new \FrontendForms\InputDate('date'); $inputDate->setLabel('Input Date'); // add the time range between 01-05-2023 and 30-06-2023 $inputDate->setRule('dateAfter','2023-04-30'); $inputDate->setRule('dateBefore', '2023-07-01'); $form->add($inputDate); For the second issue I guess I have to write a new custom validator, which takes care of the date in the first field. I will take a look what I can do :-)
  4. No other issues have been reported till now and I have tested the module once more and have fixed some problems. Now the module works as expected in my case without problems. Today I have added the module to the module directory - please download it from there after it has been published. Thanks!
  5. Version 1.2.3 is ready! PLEASE DEINSTALL THE OLD VERSION OF FRONTENDLOGINEGISTER AND UPGRADE FRONTENDFORMS TO THE LATEST VERSION BEFORE, BECAUSE THERE ARE A LOT OF CHANGES AND NEW FEATURES!! OTHERWISE YOU WILL GET ERRORS! Beside fixing a lot of bugs, this new version supports upload for an user image too. Supported Fieldtypes for images are FieldtypeImage and FieldtypeCroppableImage3. Please note: You can only use ProcessWire image fields with single upload - multi-upload fields will be ignored and cannot be selected. So if you want to use an existing image field or you need to create a new one, take care to set the image upload only to 1 single file. After you have added this field to the user template, you can select this field inside the module configuration and add it to the profile form and/or to the registration form. Take also care that this field is editable by the user, otherwise it will also not be selectable. Just to mention: Technically you can add as many image fields as you want to these 2 forms, but it would not make sense, because each user needs only one image. But if you want.... you can. There were a lot of changements taken, so please let me know if you discover issues. Best regards
  6. Hello I have also tried to implement this solution to one of my modules, but I cannot get it to work and there are some questions open: Should I create this file manually and store it inside the module folder? I have tried this, but I cannot point the update url to this file by changing the config values as pointed out in this post: I have replaced "http://domain.tld/" with my GitHub account url "https://github.com/juergenweb/" but this points not to my manually created json file. It leads to "https://github.com/juergenweb/nameOfMyModule/?apikey=pw300" and not to "https://github.com/juergenweb/nameOfMyModule/myupdatefile.json". So the "?apikey=pw300" will not be resolved to point to the json file. Is there a special naming convention for this json file, if it should be created manually? Is this important to change too? Can someone give me an example of how I should do it by using a module located on a GitHub account?
  7. You will pass every police interview! ?
  8. OK, other people have struggled with same problem too. Using the module upgrade() function is the way to go, that works. https://processwire.com/talk/topic/26912-module-update-function/#comment-222616 Problem solved ?
  9. Yeah, I have tried that, but nothing had happened. But maybe I have done something wrong. I will take a look if owerwriting, as you have it done, will be the better way to go. Thanks for your help!!!
  10. Hello @all I need a Hook that will run after a user updates a module from the PW module directory. The reason for that is, that the update only affects files which are inside the updated module itself. If a module creates files or directories on other places of the systen, they will never get affected during an update. In my case, my FrontendForms module copies a file (captchaimages.php) from the module to the root directory of the PW installation during the installation process of the module. The problem is, if I update this file, running an update will never updates the file in the root directory. So this file will never be touched again after the installation. For this reason I need a Hook, that will run after a module was updated successfully, so I can write a code to update this file manually (or in other words to replace the file inside the root with the file from the update version). Can anyone help me if there is an appropriate Hook. Thanks in advance
  11. Hello @Mfeuille Thanks for reporting your issue! Can you confirm that you have the required PHP version (8.0) installed. It seems that your system does not understand the union types on that lines. This is the case if you have a lower PHP version. Best regards Jürgen
  12. This is the next module beside the FrontendLoginRegister module which is based on the FrontendForms module. As the name suggests, it has been designed to easily create a contact form for your site with the following characteristics: Fast and easy integration of a contact form inside a template by using only one line of code Show/hide certain fields of the form depending on your preferences and needs Beside the default fields you will be able to extend the form with additional fields if needed Highly customizable (change order of fields, add custom CSS classes,...) Run as many forms on one page as you want Possibility to offer file upload to upload multiple files, which can be sent as attachments Usage of all the benefits of FrontendForms (fe. CAPTCHA, various security settings,...) Multi-language IP of the sender will be send with the email too, so you can use it for IP-blocking if you will get a lot of spam from a certain IP To render a complete working contact form, you will only need to add this line of code to your template: echo $modules->get('FrontendContact')->render(); The output can differ from the image above, because it depends on your settings and customizations, but it will looks like similar to the form in the image. This module is completely new and therefore alpha stage - so be aware of using it on live sites! It works as expected in my tests, but it will need further testing. You can download the module here: FrontendContact or you can install it via the Processwire upgrade-module from the module directory. Alternatively you will find all files inside GitHub. You will also find a more detailed description on the the download page. Live example of this module: https://www.schulfreund.at/kontakt/ As always, please report issues or wishes here or directly on GitHub. Thanks for testing!
  13. @Andy I will probably thinking over to add this feature (support for image upload). Technically, uploading an image without image manipulation should not be a problem in this case. At the moment I am quite busy on creating a new module for a contact form based on FrontendForms, but if I have more time left, I will probably give this feature a chance. Best regards
  14. Hi Andy, Maybe you are thinking of profile images? I have thought about it, but my experience in the the past has shown me, that users do not upload profile images. A few years ago I have created a user registration with the opportunity to upload a profile image, but no one has used it... so I dont think so, because it would only make sense if you can manipulate (crop, position,..) the image after the upload to get the best fit for the image. This is very complex to implement. Best regards
  15. Thank you for the hint @eydun I have added the requirements to the docs.
  16. The custom user fields will be taken from the user template and mapped to the FrontendForms class. So PW fields will be re-written to FrontendForm fields. Take a look at https://github.com/juergenweb/FrontendLoginRegister#support-for-custom-user-fields Some of the values as set in the PW fields will be added to the FrontendForm fields too. Example: If you take the PW password field and you have set the requirements to at least "1 letter and 1 digit", this requirement will also be used in the Frontendforms input field for the password on the frontend. Validation will only be taken by FrontendForms. Does this answer your question?
  17. Ok, Claus! You are close to the solution.? You will get every value by its name attribute. To add all of them to the body, I recommend you concatenate all the values in one string. $email = $form->getValue('email'); $message = $form->getValue('message'); If you have all of your $_POST values than you create your body string (fe with a little HTML markup). $body = '<ul><li>Email: '.$email.'</li><li>Message: '.$message.'</li></ul>; As the last step, add it to the mail body: $m->body($body); // or if you want to use HTML markup $m->bodyHTML($body); You will find a working example at https://github.com/juergenweb/FrontendForms/blob/main/Examples/contactform.php Best regards PS: If you will need help, please post the code of your form here.
  18. Hello Claus, thank you for reporting the bug - it is fixed now. There was a missing typehint declaration at the label file. I have updated the module now to 2.1.26 - alternatively please replace the folllowing file: https://github.com/juergenweb/FrontendForms/blob/main/Formelements/Textelements/Label.php On line 20 I have changed the following: protected int $enableAsterisk = 1; // to protected int|string $enableAsterisk = 1; Best regards Jürgen
  19. A module for ProcessWire CMS to integrate a user registration/login functionality based on the FrontendForms module. This module creates pages and templates during the installation for faster development. The intention for the development of such a module was to provide a ready-to-use solution for user management, which can be installed and put into operation in a few minutes. It works out of the box, but it provides a lot of configuration settings in the backend: Highlights "One-click" integration of an user login/registration system without the hazzle of creating all pages and forms by hand "One-click" switch between login or login and registration option Double opt-in with activation link on new registrations Option for automatic sending of reminder mails, if account activation is still pending Option for automatic deletion of unverified accounts after a certain time to prevent unused accounts Option to use TFA-Email if installed for higher security on login Mutli-language Select if you want to login with username and password or email and password Select the desired roles for newly created users Select, which fields of the user template should be displayed on the registration and profile form (beside the mandatory fields). Fields and order can be changed via drag and drop functionality Offer users the possibility to delete their account in the members area using a deletion link with time expiration Customize the texts of the emails which will be send by this module Usage of all the benefits of FrontendForms (fe. CAPTCHA, various security settings,...) Support for SeoMaestro if installed Lock accounts if suspicious login attempts were made Support of Ajax form submission This module runs on top of the FrontendForms module, so please download and install this module first. UPDATE 03.11.2023: The module is now available inside the Processwire modules directory: Frontendloginregister This module is early Beta stage, so please do not use it on live sites at the moment. If you discover any issues, please report them directly on GitHub ?. Thanks!
  20. This works!!! Thank you so much!!! I can confirm, that the fieldset was always closed in my case. Maybe it has something to do, that the error was produced by a custom inputfield validator via a Hook. Best regards Jürgen
  21. Hello @all I have a configurable module and for better overview i have created a lot of fieldsets where I have placed configuration fields inside. By default all fieldsets are closed. So if an error occurs in one field after saving the module, I get the error message at the top, but the fieldset which includes the field with the error keeps closed. This is not very userfriendly, because you will not know in which of the fieldsets is the field which causes the error (I know, where to look, but someon who does not know my module will not...) So it would be great if the fieldset with the error field inside will be opened, after the form processing. Is there an inbuilt way to achive this or has someone struggled with the same problem and has found a working solution and will be so kind to post it here? Thanks in advance
  22. Hello @xweb The placeholder is an attribute and you can add every attribute with the setAttribute() method described here. $yourField->setAttribute('placeholder', 'Enter your first name'); // or with translatable strings $yourField->setAttribute('placeholder', _('Enter your first name')); Replace $yourField with the variable name of your field object and your done ?! You can do this in the same way for every attribute (class, data-attribute, id, rel,.....). Have a nice day! Jürgen
  23. Version 2.1.19 contains changes to make the module compatible with PHP 8.2 and following versions. All dynamically created properties have been removed and replaced by a declared property which hold all the properties inside an array. The reason for this is that dynamicalle created properties will be depreciated in 8.2 (leads to a warning) and the will be forbidden in upcoming PHP 9. So, this was a change affecting a huge amount of files. So please test it carefully and report any issues directly on GitHub. IMPORTANT! Due to a writing mistake, there are wrong values inside the database: These wrong values will not be overwritten during the update. It is recommended to uninstall and reinstall the module after the update to be sure that the correct values are stored inside the database. Otherwise it is most likely that you will get an error after a form submission. Just to mention: the error is in the fieldname of the custom messages: instead of the field name "input_alertErrorText" and "input_alertSuccessText" I have written "input_input_alertSuccessText" and "input_input_alertErrorText". This causes an error after form submission. Thanks a lot!
  24. Could you please download and replace the following file: https://github.com/juergenweb/FrontendForms/blob/main/FrontendForms.module Let me know, if the error is gone
  25. Ok, give me a minute, I will add an if condition. In the meantime you can take a look at the example of uploading a file to page. https://github.com/juergenweb/FrontendForms/blob/main/Examples/fileuploadtopage.php This is the way to go - I have tried it and it works in my case.
×
×
  • Create New...