Great Ideas. Always Flowing.

We are not happy until you are happy. Client satisfaction guaranteed. Whatever your needs and requirements, we have the skills and resources for the job!

Quick login...


Or... now make it easy with Facebook Integration
Connect via Facebook



Top Sellers

Frustrated over the lack of customization for your user's registration fields? Dynamically setup your DNN Portal with custom registration fields, layout, questions, and other core integration options......

Ultra Video Gallery is a brother product of Ultra Media Gallery, UVG allows you to upload videos in various format and automatically encode them to flv or H264 format, you also can add videos from internet or record live videos from your webcam.

Build high performance, completely customizable data-entry forms and views driven by your DNN and external databases. New built-in tools make it a snap to quickly create data entry forms, data views, and even database tables. Plus, add your own HTML, CSS, Javascript, SQL commands, stored procedures,

The most advanced DotNetNuke shopping cart on the planet. Easy to use e-Commerce, Secure Shopping Cart Software and SEO friendly. B2C / B2B Ecommerce Sites.

One stop solution for events calendar and events registration! FREE DOWNLOAD is available now!

Validating a users age
Last Post 09-30-2013 05:27 AM by Ryan Bakerink. 1 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
NextNext
You are not authorized to post a reply.
Author Messages Not Resolved
AlexUser is Offline
new to the springs
new to the springs
Posts:1
Avatar

--
09-25-2013 08:53 PM
    Hello, we have a custom profile property named "DOB", and we have Dynamic Registration writing into that perfectly using the 3 dropdowns (day, month, year).

    How is it possible to validate a date within Dynamic Registration? We want to make sure that a user is at least 18 years old.

    Can this be done? Could you give a small example to point me in the right direction please?

    Thanks!
    Ryan BakerinkUser is Offline
    river guide
    river guide
    Posts:1900
    Avatar

    --
    09-30-2013 05:27 AM
    Hello Alex,

    There are 2 different ways in which you can perform this validation:

    * SQL Validation
    * JavaScript (on Client Side Event)

    It really depends on how you'd like to handle this validation, on the client side or server side. Client side is usually a more elegant solution for this type of validation.

    I would recommend trying the following JavaScript function that I found on the web:

    ---------------------------------------
    function getAge(dateString) {
    var today = new Date();
    var birthDate = new Date(dateString);
    var age = today.getFullYear() - birthDate.getFullYear();
    var m = today.getMonth() - birthDate.getMonth();
    if (m < 0 || (m === 0 && today.getDate() < birthDate.getDate())) {
    age--;
    }
    return age;
    }
    ---------------------------------------

    Add this function to Module Configuration -> Advanced Coding Options -> Custom JavaScript file -> JavaScript file.

    Be sure to completely refresh your webpage after saving this function and exiting the admin configuration interface.


    There are a couple things to note. If the validation fails, you'll probably want to inject informative text into a span or label using innerHTML , and you'd probably want to disable/hide the submit button until this validation is satisfied. If the validation passes, you'll want to clear the informative text in the span/label and display/enable the submit button.

    Please let us know if you have any questions.

    Thanks,

    Ryan


    You are not authorized to post a reply.


     
     

    Join our mailing list...

    Get current news and events the easy way
    Subscribe Me

    Recent Blogs...

     
    Copyright 2005 - 2011 by Data Springs, Inc.
     
  • film izle
  • 720 izle
  • film
  • sinema izle
  • film makinesi
  • T�rk�e dublaj film
  • film izle
  • film izle
  • baglan film izle
  • sinema izle
  • 1080 film izle
  • film mercegi