Advertisement

09.07.2008 at 01:13PM PDT, ID: 23710542
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.2

Date validation return Nov 2007 when I enter Sept 8, 2008

Asked by Farzadw in JavaScript

Tags:

I'm not a javascripter. got this code from someone...why when i pass this function 09/08/2008..it comes out as invalid.I put in alert steps and last line brings back Friday Nov 2007..why??Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
function checkDate( val ) 
{ 
      euro = parseInt(document.getElementById(euroid).value) == 0; // true if euro dates 
    alert (val);
    if ( val.length == 0 ) return true; 
    
    if ( ! validformat.test( val ) ) return false; 
    alert("mmm");
     
    //Detailed check for valid date ranges 
     var temp = val.replace("-","/").split("/"); 
     
     alert("temp");
     alert(temp);
    
     // the euro flag lets us pick month and day from right elements of the split: 
    var mnum = parseInt(temp[ euro ? 1 : 0]) - 1; // js months start at zero 
    var dnum = parseInt(temp[ euro ? 0 : 1]); 
 
    var dtest = new Date( parseInt(temp[2]), mnum, dnum ); 
    
    alert("dtest");
    alert(dtest);
    
    alert("mnum");
    alert(mnum);
    alert("before get month");
    alert(dtest.getMonth());
    // if the month isn't the same, then day was too large for given month 
    // alert( dtest + "\n" + mnum + "\n" + dtest.getMonth() ); 
    return  ( mnum == dtest.getMonth() ); 
}
 
Loading Advertisement...
 
[+][-]09.07.2008 at 02:15PM PDT, ID: 22412928

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: JavaScript
Tags: Javascript
Sign Up Now!
Solution Provided By: hielo
Participating Experts: 1
Solution Grade: A
 
 
[+][-]09.07.2008 at 02:22PM PDT, ID: 22412963

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.07.2008 at 02:30PM PDT, ID: 22413019

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.07.2008 at 02:35PM PDT, ID: 22413045

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.07.2008 at 02:52PM PDT, ID: 22413117

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628