TOPIC:

I need to validate the kalender to ... 8 years 6 months ago #65160

  • Topic Author
  • cocosoft
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 2
  • Thanks: 0
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

Please Log in or Create an account to join the conversation.

Re: I need to validate the kalender to ... 8 years 6 months ago #65244

  • TheMuffinMan's Avatar
  • TheMuffinMan
  • Offline
  • Developer
  • Developer
  • Posts: 9159
  • Karma: 167
  • Thanks: 741
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

Please Log in or Create an account to join the conversation.

Re: I need to validate the kalender to ... 5 years 1 month ago #148400

  • med-eb
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 3
  • Thanks: 0
Moin, wie funktioniert das in der BreezingForms 1.8.5 Stable (build 869) Version?

Please Log in or Create an account to join the conversation.

Re: I need to validate the kalender to ... 5 years 1 month ago #148402

  • chrisal's Avatar
  • chrisal
  • Offline
  • Ultimate Breezer
  • Ultimate Breezer
  • Posts: 6983
  • Karma: 187
  • Thanks: 629
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

Please Log in or Create an account to join the conversation.

Re: I need to validate the kalender to ... 5 years 1 month ago #148404

  • med-eb
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 3
  • Thanks: 0
Nun, es passiert gar nichts. Ich verwende den "Responsive Kalender"

auf dieser Seite: stullenmanufaktur.med-eb.de/anmelden

Please Log in or Create an account to join the conversation.

Re: I need to validate the kalender to ... 5 years 4 weeks ago #148658

  • chrisal's Avatar
  • chrisal
  • Offline
  • Ultimate Breezer
  • Ultimate Breezer
  • Posts: 6983
  • Karma: 187
  • Thanks: 629
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

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
  • 2
Moderators: ForumSupport
Time to create page: 0.052 seconds

Summer Sale!

Massive discounts on all subscriptions!

Get Your Subscription Here

Quick Links

Downloads

BreezingForms

ContentBuilder

BreezingCommerce

Templates

Documentation

BreezingForms

ContentBuilder

BreezingCommerce

Apprendre BreezingForms (French Community)

Apprendre et maîtriser BreezingForms par des tutoriels et exemples, le tout en français

breezingforms.eddy-vh.com

Questions et réponses sur les forums de l'AFUJ

AFUJ

Special Offer

Summer Sale! All subscriptions at a special price!

Includes prio support, all of our current and future Joomla!® extensions and Joomla!® templates for the duration of your membership.

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!