I need to validate the kalender to ...

  • cocosoft
  • Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 2
  • Thank you received: 0

cocosoft created the topic: I need to validate the kalender to ...

Hi,

I need to validate the kalender with a script to make sure that the user cannot select a saturday or sunday. Can somebody help me to write this new script?

Kind regards,
Eric
#65160
  • Posts: 7465
  • Karma: 150
  • Thank you received: 553

TheMuffinMan replied the topic: Re: I need to validate the kalender to ...

Hi and Happy New Year!

Try this (supposing QuickMode, but works in other modes as well):

- Go to Calendar Element => Validation => check Required => click "Custom" => click "create code framework"

- Inside the generated function, remove this
if (element_fails_my_test) {
        if (message=='') message = element.name+" faild in my test.\n"
        ff_validationFocus(element.name);
        return message;
    } // if

.... and replace it with this
// assuming date form is US, if it is different, then some transformation should be placed here before handing to the Date object
var my_date = new Date(element.value);

// 0 is sunday, 6 is saturday
if( my_date.getDay() == 0 || my_date.getDay() == 6 ){
   ff_validationFocus(element.name);
   return 'Please choose a different day than saturday or sunday';
}
return '';

Not tested but should work out of the box.

Regards,
Markus

===============================================
Support Crosstec and get ALL EXTENSIONS and professional support for just $5
Here!
===============================================
Satisfied?
Consider a membership!
===============================================
Like us on Facebook
===============================================
#65244
  • Posts: 3
  • Thank you received: 0

med-eb replied the topic: Re: I need to validate the kalender to ...

Moin, wie funktioniert das in der BreezingForms 1.8.5 Stable (build 869) Version?
#148400
  • Posts: 6983
  • Karma: 187
  • Thank you received: 628

chrisal replied the topic: Re: I need to validate the kalender to ...

Hallo med-eb,


das sollte in der neuen Version genau so funktionieren.

Bekommst du irgendeine Fehlermeldung, wenn du es versuchst?


Mit freundlichen Grüßen
Chris

Regards,
Christian

===============================================
Satisfied? Consider a membership!
===============================================
Like us on Facebook
===============================================
Follow us on Twitter
===============================================
#148402
  • Posts: 3
  • Thank you received: 0

med-eb replied the topic: Re: I need to validate the kalender to ...

Nun, es passiert gar nichts. Ich verwende den "Responsive Kalender"

auf dieser Seite: stullenmanufaktur.med-eb.de/anmelden
#148404
  • Posts: 6983
  • Karma: 187
  • Thank you received: 628

chrisal replied the topic: Re: I need to validate the kalender to ...

Hallo nochmal,


leider habe ich kein Zugang zu dem Bereich. Ist es vielleicht möglich, mir das Paket des Formulars an den nächsten Beitrag anzuhängen, damit ich mir das mal angucken kann?


Mit freundlichen Grüßen
Chris

Regards,
Christian

===============================================
Satisfied? Consider a membership!
===============================================
Like us on Facebook
===============================================
Follow us on Twitter
===============================================
#148658
Moderators: ForumSupporttomeperica
Time to create page: 0.071 seconds

New Icon Packs Category!

Crosstec is now offering icon packs.

If you are a paying subscriber, icon packs are automatically added to your account.

Check out our icon packs page!

Live Support Chat Opened!

Join our Discord chat here to receive live support and talk directly to the team!

Summer Sale!

50% discount on all of our extension subscription plans, templates and icon packs!

Get Your Subscription Here

News and Updates

Get informed about new downloads, updates and more in our News and Updates newsletter.

All Extensions Subscription

Get 1 year access to all of our current and future products and 1 year of professional support -- 99 for just 49! (Summer Sale)

No support per domain or website installation limits! Includes all of our current and future Joomla!® extensions, Joomla!® templates for the duration of your membership. This means, by purchasing an All Extensions Subscription you'll have it all covered!

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to sales@crosstec.org with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!

Live Support Chat Opened!

Join our Discord chat here to receive live support and talk directly to the team!

Community Reward

Help us to create new extensions and plugins! With only $5 you help us a lot and get unlimited download access to all of our products, professional support and even more. Get your reward now!

Read More Here