TOPIC:

Age Calcualtion 2 weeks 5 days ago #261196

  • Mirec's Avatar
  • Mirec
  • Offline
  • Gold Breezer
  • Gold Breezer
  • Posts: 454
  • Karma: 2
  • Thanks: 19
HI,

is everything ok now? :)

Regards,
Mirko

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

Age Calcualtion 2 weeks 5 days ago #261197

  • Topic Author
  • papin0
  • Offline
  • Senior Breezer
  • Senior Breezer
  • Posts: 143
  • Thanks: 0
Yes, is working with this:
ff_age_init();
ff_hidesecs_init();


} // ff_newreferralform_init

//HERE YOU SEARCH IN CAPS/LOWER CASE WITHIN THE SELECT LIST WITH A TEXT FIELD
jQuery.expr[':'].icontains = function(a, i, m) {
return jQuery(a).text().toUpperCase()
.indexOf(m[3].toUpperCase()) >= 0;
};
//END HERE YOU SEARCH SELECT LIST WITH A TEXT FIELDS

// AGE CALCULATION
function ff_age_init()
{
setInterval('ageCal()', 500);
} // ff_referralform_init
function ageCal() {
var dateOfBirth = ff_getElementByName('dob').value;
var today = new Date();
var birthDate = new Date(dateOfBirth);
var age = today.getFullYear() - birthDate.getFullYear();
var m = today.getMonth() - birthDate.getMonth();
console.log(m);
if (m < 0 || (m === 0 && today.getDate() < birthDate.getDate())) {
age--;
ff_getElementByName('age').value = age;
}else{
ff_getElementByName('age').value = '';
}
}

// HIDE SECTIONS BASED ON AGE
function ff_hidesecs_init()
{
setInterval('myfunc()',500);
}
function myfunc(){
if (jQuery('[name="ff_nm_age[]"]').val() > 17) {
bfToggleFields('on','section','phone1sec',bfDeactivateField);
bfToggleFields('on','section','phone2sec',bfDeactivateField);
bfToggleFields('off','section','parents',bfDeactivateField);
bfToggleFields('off','section','school',bfDeactivateField);
bfToggleFields('off','section','legalguardian_sec',bfDeactivateField);
}else{
bfToggleFields('on','section','parents',bfDeactivateField);
bfToggleFields('on','section','school',bfDeactivateField);
bfToggleFields('on','section','legalguardian_sec',bfDeactivateField);
bfToggleFields('off','section','phone1sec',bfDeactivateField);
bfToggleFields('off','section','phone2sec',bfDeactivateField);
}
} // END HIDE SECTIONS BASED ON AGE

I just made a few changes but everything is your code.

Thanks

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

Age Calcualtion 2 weeks 5 days ago #261198

  • Mirec's Avatar
  • Mirec
  • Offline
  • Gold Breezer
  • Gold Breezer
  • Posts: 454
  • Karma: 2
  • Thanks: 19
Hi,

super! :)
I'm glad I can help you!

If you need more help feel free to ask!
Regards,
Mirko

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

Age Calcualtion 2 weeks 5 days ago #261202

  • Topic Author
  • papin0
  • Offline
  • Senior Breezer
  • Senior Breezer
  • Posts: 143
  • Thanks: 0

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

Age Calcualtion 2 weeks 4 days ago #261225

  • Mirec's Avatar
  • Mirec
  • Offline
  • Gold Breezer
  • Gold Breezer
  • Posts: 454
  • Karma: 2
  • Thanks: 19
Hi,

okay, currently I working on it.

Regards,
Mirko
The following user(s) said Thank You: papin0

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

Moderators: ForumSupport
Time to create page: 0.049 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!