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!

Client Side Script
Last Post 08-27-2012 08:34 AM by Ryan Bakerink. 6 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
Patrick SantryUser is Offline
new to the springs
new to the springs
Posts:5
Avatar

--
11-09-2008 11:59 AM

    I don't understand how the client side scripting feature works.

    For example I have a text field for people to enter in their date of birth. I want to call a function I have called checkDOB, in this function I parse the date and calculate the age. If the age matches the right age, then display the submit link, else it will display an alert to the user stating that you have to be 13 or over.

     

    I have the client side code all written, but I can't make out where to put it all. I placed the call to the function in the question for onblur, looked at the code and it looks good there. I added in the function in both the custom javascript file in both fields there, but it doesn't work in either. From what I see this should work, but it doesn't.

    Can anyone tell me how to get this working?

     

    Thanks.

    CandaceUser is Offline
    river guide
    river guide
    Posts:2431
    Avatar

    --
    11-10-2008 10:00 AM
    Hi. I would download something like FireFox FireBug to help determine what the exact javascript that is getting rendered/called. Also, I think when you go and 'Update Javascript File' you need to click Refresh/F5 after exiting the settings before the new javascript file will be rendered.

    Yes you should have the function call within the custom javascript file and then call it from the client side event (onblur)

    Something like
    $(YourField) = YourFunctionCall('$(YourField_FieldID)')

    This would set the value of the field to whatever is returned from your function call, and calling the function is also passing it your field ID so that it can reference and perform calculations etc...

    IF you still have problems please setup the javascript you are using and your implementation on www.betasprings.com (login as host/dnnhost) and we will review it to let you know where you are having the problem.

    -Chad
    Colin MurrayUser is Offline
    new to the springs
    new to the springs
    Posts:1
    Avatar

    --
    05-19-2009 07:00 AM

    Patrick,

    Were you able to get this to work?  I need something similar and was hoping you could help me out.

    Thanks,

    Colin

    AngelaUser is Offline
    wading in the water
    wading in the water
    Posts:17
    Avatar

    --
    08-27-2012 06:05 AM
    Did someone figure this out?  I need the exact same thing.  Have a Date Field where people can input their birthday and then I would like it to auto calculate their age and display in a field to the right.  I know how to do it in sql but can't figure out the question event or client side to make it work.
    Ryan BakerinkUser is Offline
    river guide
    river guide
    Posts:1900
    Avatar

    --
    08-27-2012 06:22 AM
    Hello Angela,

    I would recommend searching through Google for a snippet of JavaScript to calculate the Age of a person based on the inputted date for their birth date.

    You can search on Google:
    * JavaScript Calculate Age from Birthdate
    * JavaScript Calculate Age
    * JavaScript find age

    Once you find the snippet of JavaScript(most likely a function) then you can plug this into Dynamic Registration -> Module Configuration -> Custom JavaScript File -> JavaScript file and paste the function into this section, then save.

    Now you'll want to call the JavaScript function in the OnClient side section of your Birthday/Birth date Dynamic Registration question(under Advanced Question Options).

    Please let me know if you have any questions.

    Thanks,

    Ryan
    AngelaUser is Offline
    wading in the water
    wading in the water
    Posts:17
    Avatar

    --
    08-27-2012 07:37 AM
    Thanks Ryan - I'll be the first to admit my Java isn't the best. I did find a function to calculate Age, added it to the JavaScript File. But how would I call it?

    I have one date field (DOB0 using the Calendar Text box, then another field (Age) in which I wanted to used to display the age. Under the Age Field, do I just put in the client side the name of the function?
    Below is the Java I believe can be used.

    function getAge(dateString)
    {
    var today = new Date();
    var birthDate = $(DOB); ----- Do I change this to my Dynamic Form Field?
    var age = today.getFullYear() - birthDate.getFullYear();
    var m = today.getMonth() - birthDate.getMonth();
    if (m < 0 || (m === 0 && today.getDate() < birthDate.getDate()))
    {
    age--;
    }
    return age;
    }

    thanks for any help.

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

    --
    08-27-2012 08:34 AM
    Hello Angela,

    You could always Google how to call a JavaScript function too lol. Believe me, Google will provide you with more details than I can provide you in the forums.

    Anyways, with the JavaScript function that you have, the name of it is getAge, and it accepts one parameter -- the date.

    So the function call will probably look like this:

    getAge($(DOB));

    As for $(DOB) inside the JavaScript function, you'll have to figure out what the value is for your DOB textbox. Or you can easily add another JavaScript parameter to your function that passes the ID of your textbox. For an additional Parameter to the Function, the function call may look like this:

    getAge($(DOB), $(DOB_FieldID));

    These are tokens within Dynamic Forms if your textbox's shortfield name is DOB.

    Unforunately Data Springs can't support JavaScript programming language without the utilization of Premium Integration Services:
    https://www.datasprings.com/support/premium-support/premium-support-options

    I will confirm that Google has all of the answers to your questions, all you'll need to do is ask the appropriate questions to get the appropriate answers.

    If you would like our assistance with this, I can confirm that this would take .25 - .75 Premium Integration Hours to complete. However the minimum # of hours that you can purchase is 3. So anytime that's left over you can use towards us training you in a one on one format, or any other issues or implementations you'd like our assistance with. If you'd prefer to save the left over hours for a rainy day, we would keep this on file for you until you're ready to redeem them.

    Please let me 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