× Form Help

Age Restrict

  • Posts: 5
  • Thank you received: 0

ideasgirl replied the topic: Age Restrict

The date format was using "-" as separator and I changed it but the form still not going through. It just hangs.

#236838
Attachments:
  • Posts: 2428
  • Karma: 85
  • Thank you received: 330

mihaela replied the topic: Age Restrict

Hello again,

After reviewing your code once more I see that you have put the wrong field name here:
function ff_dateField_validation(element, message)
From the rest of your code, I assume that the name of the field is 'fecha_nacimiento' and therefore it should be:
function ff_fecha_nacimiento_validation(element, message)

Also, if you prefer to continue using dd-mm-yyyy date format you just have to replace this line of code:
var dobParts = dateBirth.split("/");
with this one:
var dobParts = dateBirth.split("-");

Let me know whether the above resolves the problem.

Regards,

Mihaela
#236844
  • Posts: 5
  • Thank you received: 0

ideasgirl replied the topic: Age Restrict

Wow! I missed that one.

Yes, I figured out the "-" or "/" part, it's really not an issue.

Thanks!
#236862
  • Posts: 5
  • Thank you received: 0

ideasgirl replied the topic: Age Restrict

No, actually... it's not working.

The formula doesn't work because unless I enter the person is 18 or 85 exactly it gives the error message. I tried few changes, but doesn't validate. :(
#236870
  • Posts: 2428
  • Karma: 85
  • Thank you received: 330

mihaela replied the topic: Age Restrict

Hello again,

That is because of the way that you have written the script.

You need to replace this line of code:
else if(age == 18 || age == 85) { return '';}
with this line of code:
else if(age >= 18 && age <= 85) { return '';}

Let me know whether after this change it is working as you wanted.

Regards,

Mihaela
#236880
  • Posts: 5
  • Thank you received: 0

ideasgirl replied the topic: Age Restrict

Yes, that made the trick. Thanks!

I'm using 2 languages. How I work around the error message on the other language (since the code includes the message)?

Also, just in case my customer wants the date on a mm/dd/yyyy format, what should I change on the code?
#236898
Moderators: ForumSupporttomeperica
Time to create page: 0.198 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