Jump to content

Andy

Members
  • Posts

    160
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by Andy

  1. Hi @millipedia You have turned out to have a great website. It's really necessary work, but it's also beautiful.
  2. Hi @Juergen Got the ability to make flexible rules and a multi-step input form. The ability to make your own validation rules is a very powerful thing. Thanks.
  3. Hi @Juergen Thanks for the information. I will read the Valitron documentation more carefully. However, I need this rule quite often. I think that adding the 'cyrillicName' rule is more correct for the code. Thanx
  4. Hi @Juergen Good news everybody. Custom validation rules work. I'll add one more proven validation rule to the general collection. Check to enter a Cyrillic first, last or middle name. In ready.php // // Cyrillic name may contain lowercase and uppercase а-я and hyphen // \Valitron\Validator::addRule('cyrillicName', function ($field, $value) { $regex = '/[^а-яё\-]/iu'; if (!preg_match($regex, $value)) { return true; } return false; },'contains not allowed characters. Cyrillic name may contain lowercase and uppercase а-я and hyphen (no whitespaces).');
  5. The posts are frozen in the red zone again. Maybe some kind of restriction has been violated?
  6. Hi @Juergen I continue to admire you. Yes, that's exactly what I meant. That's what I was thinking about writing a new validation rule, just haven't decided how to do it yet. I was going to use hooks. You've shown a logical solution. Thank you. I think FrontendForms users can share their useful validation rules in this thread.
  7. Hi @Juergen Thank you for your quick response. You are always helpful. This code now works and shows an error message at the beginning of the form. However, the problem is that despite the error, the variable $form->isValid() = true. And the form submittal happens. Is there any way to tell the form that it is invalid? And make $form->isValid() = false. That would solve all the problems with additional inspections.
  8. Hi @Juergen Method: $alert0 = $form->getAlert(); $alert0->setErrorMsg($e_msg); Causes an error: Exception: Method Alert::setErrorMsg does not exist or is not callable in this context Is there any other method to set $form->isValid() to false?
  9. Hi Juergen First of all, I didn't find the setErrorMessage function in your code. But you have the setErrorMsg function. Here's the code I used: if($form->isValid()) { $selector = $sanitizer->text($form->getValue('title'), $options = ['stripQuotes'=>true,'stripSpace'=>true]); $selector = preg_replace('/[^а-яё]/ui','', $selector); If(empty($selector)){ // set an error message at the top of the form $e_msg = "The name must be in Cyrillic."; $alert0 = $form->getAlert(); $alert0->setErrorMsg($e_msg); } } However, I get an error either way: Exception: Method Alert::setErrorMsg does not exist or is not callable in this context (in wire/core/Wire.php line 563) Perhaps there is some other way to change the value of $form->isValid() to false?
  10. Hi @Juergen First of all, I didn't find the setErrorMessage function in your code. But you have the setErrorMsg function. Here's the code I used: if($form->isValid()) { $selector = $sanitizer->text($form->getValue('title'), $options = ['stripQuotes'=>true,'stripSpace'=>true]); $selector = preg_replace('/[^а-яё]/ui','', $selector); If(empty($selector)){ // set an error message at the top of the form $e_msg = "The name must be in Cyrillic."; $alert0 = $form->getAlert(); $alert0->setErrorMsg($e_msg); } } However, I get an error either way: Exception: Method Alert::setErrorMsg does not exist or is not callable in this context (in wire/core/Wire.php line 563) Perhaps there is some other way to change the value of $form->isValid() to false?
  11. I don't know why, but my previous post is in HIDDEN status.
  12. Impressive website. There's a lot to learn from you.
  13. Hi @Juergen Unfortunately, the suggested example doesn't work 18 hours ago, Juergen said: if ($form->isValid()) { //make your custom check here (fe checking a form value against the database) if(customcheck is valid){ // go on with your code } else { // set an error message at the top of the form $alert = $form->getAlert(); $alert->setErrorMessage('Sorry, but there are errors inside the form'); // set an error message on the inputfield itself (fe. an email input) $emailInput = $form->getFormElementByName('email); $emailInput->setErrorMessage('There is an error'); } } First of all, I didn't find the setErrorMessage function in your code. But you have the setErrorMsg function. Here's the code I used: if($form->isValid()) { $selector = $sanitizer->text($form->getValue('title'), $options = ['stripQuotes'=>true,'stripSpace'=>true]); $selector = preg_replace('/[^а-яё]/ui','', $selector); If(empty($selector)){ // set an error message at the top of the form $e_msg = "The name must be in Cyrillic."; $alert0 = $form->getAlert(); $alert0->setErrorMsg($e_msg); } } However, I get an error either way: Exception: Method Alert::setErrorMsg does not exist or is not callable in this context (in wire/core/Wire.php line 563) Perhaps there is some other way to change the value of $form->isValid() to false?
  14. I have a question about additional checks. How can I organize custom checks on the database? For example, how can I prohibit duplication of e-mail value or participant's number or full namesake?
  15. I think it is possible even now. You can add a “I agree with the personal data policy” field to the customer profile. And make a link to the policies outside the form.
  16. Hi @bernhard This project looks extremely interesting. I use Tabulator for frontend and find it one of the best solutions for tables. It's great that you have made it easier to use it in the backend. Thank you for another one great module. By the way, I have up to 50 columns in a table, and the database has over 1,000,000 items. However, it doesn't make much sense to make tables of even 10,000 rows. It is better to categorize them and show them in separate tables.
  17. As far as I understood from the documentation, the module is based on the well-known library https://github.com/moneyphp/money. This library is used by a lot of people who have to calculate finances. Yes, this library stores finance values in integer variables. That is, in cents. You are right. Why, are there other solutions? Today @bernhard made it easy for us to integrate this library into ProcessWire. Many thanks to him. What are modules written for? To speed up development. This module will speed up development? Yes, it will. That's what we need. I once spent a lot of time and effort to integrate PDF formatting into a project. And then I took the RockPDF module and did in a couple of hours what had taken me a month before. Thanks to @bernhard for his modules, which are beautiful.
  18. @ryan I wish you a wonderful trip. Personally, traveling motivates me and keeps me from burnout. Thank you for your work. Hope to see a sequel. Also a huge thanks to @Robin S for his modules. I use some of them in my projects. I would also like to thank other members of the ProcessWire community who post their modules, developments and tips. Without you I couldn't have done much. Hugs to all of you!
  19. Hi @wbmnfktr I think generic layouts should cover more functionality and showcase features. Skyscrapers - A perfect illustration of map integration. Add to this the skyscrapers of Hong Kong (554 skyscrapers) and add Chinese language in the frontend. I think the multi-language functionality in PW is the best of any CMS. I had a client who wanted a website to have the following languages: English, Greek, Russian, Chinese. The only problem was finding a font that has all the lettering. I love ProcessWire's multilingual tools. The Shop - is a simple store layout for simple products. No taxes or shipping, just an order cart and that's it. It's a seed on which a big tree can grow later. Admin dashboard in backend - This functionality is available in many CMSs. A typical layout will show beginners how easy it is to customize the backend to suit their needs. Making an appointment - is a booking system for anything. This is a pretty common task that happens when you need to book a hotel, buy airline tickets from make an appointment with a dentist. This kind of layout will be useful to many people. I proceed from the premise that typical PW installations should show the functionality and flexibility of this system. Of course, ProcessWire's capabilities are much broader and constantly evolving. I have tried to point out only the key needs. What else can be illustrated? For example, flexible customization of access levels and user roles.
  20. Thanks @Juergen I announced your module in the site description too.
  21. Thanks @Juergen This site is on the list of this forum and it states what I use. your form. If you are interested, your form is here: https://surfdacha.com/en/booking/ Website published here
  22. Hi @Juergen Thank you for your work. I have implemented your form in a working project. And so far it is working without any problems. Tests show that your project is sufficiently robust. My advice for the future, it's just an interesting opportunity.
  23. Hi @Juergen There appears to be a useful captcha in modules. Do you think it could be attached to your forms?
  24. DaCha is a water sports center in Egypt and a hotel. https://surfdacha.com/en/ Multi-language. The backend implements the management of customer reservations and bookings. Naturally, the website is made on ProcessWire. UiKit 3 layout Modules: LoginRegisterPro, Cookie Management Banner, Map Marker, FrontendForms, Markup Sitemap XML, Video embed for YouTube (and Vimeo), Tracy Debugger. The backend implements the management of customer reservations and bookings.
      • 8
      • Like
  25. Hi @ryan console log shows js?key=XXXXXXXXXXXXXXX:175 As of February 21st, 2024, google.maps.Marker is deprecated. Please use google.maps.marker.AdvancedMarkerElement instead. At this time, google.maps.Marker is not scheduled to be discontinued, but google.maps.marker.AdvancedMarkerElement is recommended over google.maps.Marker. While google.maps.Marker will continue to receive bug fixes for any major regressions, existing bugs in google.maps.Marker will not be addressed. At least 12 months notice will be given before support is discontinued. Please see https://developers.google.com/maps/deprecations for additional details and https://developers.google.com/maps/documentation/javascript/advanced-markers/migration for the migration guide.
×
×
  • Create New...