TOPIC:

Field responding to calendar selection 2 weeks 2 days ago #243059

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

Great :D

For NaN I will need to do some additional coding. Sorry I forgot.
I'll do it so I'll get back to you.

Also, please keep us motivated by leaving a small review here:
extensions.joomla.org/extension/contacts...orms/breezing-forms/
(Please turn off your VPN and local Apache prior reviewing as your review might get blocked)

Thank you.

Regards,
Tihana

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

Field responding to calendar selection 2 weeks 1 day ago #243134

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

Here is:
function ff_formname_init()
{ setInterval( calc, 500);
} // ff_formname_init

function calc() {
var calend = ff_getElementByName('nameofelementcalendar').value.split(".");
var d = new Date(calend[2], Number(calend[1]-1), calend[0]);
d.setMonth(d.getMonth() + 12);
var mj = ("0" +(d.getMonth()+ 1)).slice(-2);
if(isNaN(mj)) {
  return "";
}
ff_getElementByName('nameofelementtext').value=(("0"+ d.getDate()).slice(-2))+ "."+ mj + "."+d.getFullYear() ; 
}

Note: If the month is NaN returns an empty field.
if(isNaN(mj)) {
  return "";
}
This stop displaying NaN before a date is selected

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

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

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

July Sale!

Discounts for all of our extensions + support. Ending July 31st!

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!