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!

validate date entry with set date?
Last Post 07-19-2013 07:05 AM by Ryan Bakerink. 7 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
griderUser is Offline
skipping stones
skipping stones
Posts:6
Avatar

--
07-08-2013 01:42 PM
    Whether I have a textbox field or a date picker field. How do I go about using javascript to validate a date entered by a user? here's the rule:

    on August 1st of every year folks can enter a date between September - December of the current year only. After November 1st folks can enter a date between November - December of the current year or a date between February - December of the following year.

    I'm not sure if the date picker field is as flexible as the textbox field but I'm running into a wall in which to pull this little validation check off. Any help in the right direction would be helpful with a possible example.

    dates entered should be in format of mm/dd/yyyy

    oh if the date validates ok and is within range nothing should happen. if the date is out of range via month day or year it should pop up a box explaining the invalid date and reset the date field.

    TIA...

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

    --
    07-09-2013 05:40 AM
    Hello Grider,

    Having date ranges that are valid and invalid can be somewhat advanced.

    My recommended route would be to handle this:

    * JavaScript --> Client Side validation
    * SQL --> Server Side validation

    SQL will be the easiest route in my opinion. But if you're more comfortable with JavaScript you're more than welcome to perform this validation that way.

    If using JavaScript, I would recommend using the Client Side feature inside of your Date Picking Field.

    If using SQL, I would recommend using the SQL Validation inside of your Date Picking Field.

    Unfortunately we don't have examples that we can share when it comes to such a validation. This is quite specific to your requirements.

    If you need additional assistance with this inquiry, we can be of assistance via Premium Services:
    https://www.datasprings.com/support/premium-support/premium-support-options

    Configuring a validation like this may take 1-2 hours. So if you were to purchase the minimum of 3 hours, we should be able to knock this out within that time frame.

    Please let us know if you have any questions.

    Thanks,

    Ryan

    griderUser is Offline
    skipping stones
    skipping stones
    Posts:6
    Avatar

    --
    07-09-2013 07:32 AM
    So i've tried some javascript code that works in a simple html page but not in dynamic forms.

    all i'm trying to do is pull the month day and year into seperate variables, but it doesn't work nor do the get* functions appear to work under dynamic forms. Don't really understand why when they work perfectly fine in a simple html page...

    var udate = $(FirstName);
    alert(udate);
    alert(udate.getUTCMonth() + 1);
    var udatey = udate.getFullYear();
    var udatem = udate.getUTCMonth() + 1;
    var udated = udate.getUTCDate();
    alert(udatem);
    alert(udated);
    alert(udatey);
    Ryan BakerinkUser is Offline
    river guide
    river guide
    Posts:1900
    Avatar

    --
    07-11-2013 05:41 AM
    Hello Grider,

    What value does $(FirstName) token have? The issue is more than likely coming from the $(FirstName) token. Since you're using JavaScript to build this validation, I would recommend usign Google Inspector or Firefox FireBug plugins for debugging your JavaScript.

    These tools will help you out greatly to see if there are any errors on the page caused by your JavaScript statements.

    There's quite a bit that I don't know at this moment:

    1.) Is there a question in your Dynamic Form with the Shortfield name of "FirstName"?
    2.) What is the expected value of $(FirstName)
    3.) Where is this code residing? Inside of a Client side event, Initial JavaScript, etc...
    4.) When this worked outside of Dynamic Forms, what did you assign to "udate"? What value?


    -Ryan
    griderUser is Offline
    skipping stones
    skipping stones
    Posts:6
    Avatar

    --
    07-11-2013 05:20 PM
    Hey Ryan I've actually solved my issue using this portion of javascript listed.

    I do have an additional question. I'm trying to apply javascript now to a Date field (textbox/calendar date picker) but I can't seem to pass the date value to javascript using the short name field like i can with a regular textbox field. Does the date picker field use some other field name to pass the value to javascript?

    Thanks,

    Mike

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

    --
    07-12-2013 06:04 AM
    Hello Mike,

    Great to hear that you implemented what you needed with JavaScript.

    I would work around using the Dynamic Form Date Field. Instead I would use a Textbox with a jQuery datepicker. This is very easy to implement and will allow you to use the Token in your JavaScript. You can learn more about this here:
    http://jqueryui.com/datepicker/

    If your textbox responsible for collecting date values shortfieldname is "Date", then you'll want to make sure that you have some value in the Client side event for this field(which I believe you do). Then you'll want to make the jQuery datepicker call under Module Configuration -> Advanced Coding Options -> Custom JavaScript file -> Initial JavaScript:

    jQuery($(Date_#FieldID)).datepicker();

    If this looks transparent to you, be sure to include am external/internal datepicker stylesheet on the page, this is the default that jQuery provides,you can personalize this as much as you'd like:

    http://code.jquery.com/ui/1.10.3/th...ery-ui.css


    The Date Picker w/ calendar is sort of advanced and doesn't render as one may expect when using the token. Altogether, I avoid this field type at all costs.


    Please let me know if you have any questions.

    Thanks,

    Ryan
    griderUser is Offline
    skipping stones
    skipping stones
    Posts:6
    Avatar

    --
    07-12-2013 11:50 AM
    Cool Ryan. I will most definitely play around with your solution. Thank you very very much!!!


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

    --
    07-19-2013 07:05 AM
    You're more than welcome. Hope this all comes together for you.

    Have a great day!

    -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