Form Help

TOPIC:

Validate ”calendar-field” so that it isn’t possible to write anything else 2 weeks 3 days ago #252549

  • Topic Author
  • ulfak
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 12
  • Thanks: 0
Is there a way to validate the field type ”calendar” so that it isn’t possible to write anything else in the field but date and time .

We have had cases where the visitor has filled in the field with additional information besides from date and time and then the automation with Zapier / Google calendar does not work as it should.

An example where it went wrong:
2021-01-14 kl 13:13 picks up between, 14-15

In the example above the customer has written ”picks up between, 14-15” efter the time and date.

The correct inbut should only be:
2021-01-14 kl 13:13

(There is another text field for additional comments like "picks up between, 14-15" in the form)
Attachments:

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

Last edit: Post by ulfak.

Validate ”calendar-field” so that it isn’t possible to write anything else 2 weeks 2 days ago #252577

  • tihana.krivic's Avatar
  • tihana.krivic
  • Offline
  • Moderator
  • Moderator
  • Posts: 3038
  • Karma: 3
  • Thanks: 260
Hi,

give me some time, I need to test this.
After that I will get back to you

Regards,
Tihana

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

Validate ”calendar-field” so that it isn’t possible to write anything else 1 week 3 days ago #252824

  • Topic Author
  • ulfak
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 12
  • Thanks: 0
Hi, ok, that sounds good. I will consider membership again.

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

Validate ”calendar-field” so that it isn’t possible to write anything else 1 week 3 days ago #252833

  • tihana.krivic's Avatar
  • tihana.krivic
  • Offline
  • Moderator
  • Moderator
  • Posts: 3038
  • Karma: 3
  • Thanks: 260
Hi,

I haven't tested this yet, I am a little crowded (I will try to finish this today).
If there is no answer of mine, please remind me.

Thanks for understanding

Regards,
Tihana
The following user(s) said Thank You: ulfak

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

Validate ”calendar-field” so that it isn’t possible to write anything else 1 week 2 days ago #252892

  • tihana.krivic's Avatar
  • tihana.krivic
  • Offline
  • Moderator
  • Moderator
  • Posts: 3038
  • Karma: 3
  • Thanks: 260
Hi,

please go to calendar element->Properties-> and as Format set:
%Y-%m-%d kl %H:%M

After that go to this element->Properties->Validation->check Custom and put this:
function ff_NAMEOFCALENDAR_validation(element, message)
{
var pattern = /(19|20)[0-9]{2}\-(0|1)[0-9]\-[0-3][0-9]\s\w{2}\s([01][0-9]|2[0-3])\:[0-5][0-9]$/;
if(pattern.test(element.value)) return '';
if (message=='') message = element.name+" faild in my test.\n"
 ff_validationFocus(element.name);
 return message;
  
  
} // ff_NAMEOFCALENDAR_validation
Please replace NAMEOFCALENDAR with name of your calendar element (not title)

Let me know if you need anything else

Regards,
Tihana

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

Last edit: Post by tihana.krivic.

Validate ”calendar-field” so that it isn’t possible to write anything else 3 days 2 hours ago #253132

  • Topic Author
  • ulfak
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 12
  • Thanks: 0
Hi, i can confirm that it works fine. Thanks for the great help, regards Ulf

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

  • Page:
  • 1
Moderators: ForumSupport
Time to create page: 0.081 seconds

BreezingForms Pro 1.4.7 for WordPress Released!

Available in the membership section.

September Discount!

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!