Solved

Another js question

Posted on 2004-03-25
5
246 Views
Last Modified: 2013-12-18
HI Guys

I have this javascript that I have modified from anothe r function
What it need to do is two things,if the dateEstBetaCOmp is blank then validate, which it does, however I am also trying to check if the date entered is in the past I want the message to popup only when switching to beta

 v = "Estimated Beta Completion/DateEstBetaComp"
            if ( !RTGValidateForm( v ) )
            return false
                                       break      

today = new Date();
      day = today.getDate();
      month = today.getMonth();
      month++;
      year = today.getFullYear();

year = parseInt( year, 10 )
      month = parseInt( month, 10 )
      day = parseInt( day, 10 )
      var B = dateToIso( (day < 10 ? "0" : "") + (day + "") + monthShortName[month] +  (year + "").substring(2))
                var d4 =  dateToIso(document.all.DateEstBetaComp.value)
var b = true

     if ( d4.length > 0 && d4 < B )

                               {
                b = false
               msg = "Estimated Beta Completion Date entered cannot be in the past, please enter a new date"
                                 }

              if ( b == false )
      {
             alert("DATE INCONSISTENCY:  \n\n" + msg)
            return false
      }
      else return true      
0
Comment
Question by:adspmo
  • 3
5 Comments
 
LVL 31

Expert Comment

by:qwaletee
ID: 10679274
easier if you always use JS date object
0
 

Author Comment

by:adspmo
ID: 10679306
I cannot do that

This is an existing script and function set that I have to keep using
0
 
LVL 24

Accepted Solution

by:
HemanthaKumar earned 350 total points
ID: 10679345
use something similar to this condition

document.all.DateExtBetaComp.value < today && document.all.Status.value = "Beta"

add this to the existing if condition

~Hemanth
0
 

Author Comment

by:adspmo
ID: 10679362
I am thinking it is a bracket placement or something of that nature on there own the y work I need to combine for validation
case "Beta": This works
v = "Estimated Beta Completion/DateEstBetaComp"
          if ( !RTGValidateForm( v ) )
          return false
                                       break    

This works as part of another function  
today = new Date();
     day = today.getDate();
     month = today.getMonth();
     month++;
     year = today.getFullYear();

year = parseInt( year, 10 )
     month = parseInt( month, 10 )
     day = parseInt( day, 10 )
     var B = dateToIso( (day < 10 ? "0" : "") + (day + "") + monthShortName[month] +  (year + "").substring(2))
                var d4 =  dateToIso(document.all.DateEstBetaComp.value)
var b = true

     if ( d4.length > 0 && d4 < B )

                               {
                b = false
               msg = "Estimated Beta Completion Date entered cannot be in the past, please enter a new date"
                                 }

            if ( b == false )
     {
           alert("DATE INCONSISTENCY:  \n\n" + msg)
          return false
     }
     else return true    

0
 

Author Comment

by:adspmo
ID: 10681147
Here is what I came up with

  if ( d4.length > 0 && document.all.RequestStatus.value !== "Beta"&& d4 < B )
0

Featured Post

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For users on the Lotus Notes 8 Standard client, this article provides information on checking the Java Heap size and adjusting it to half of your system RAM in attempt to get the Lotus Notes 8.x Standard client to run faster.  I've had to exercise t…
You’ve got a lotus Domino web server, and you have been told that “leverage browser caching” is a must do. This means that we have to tell the browser everywhere in the web to use cache. In other words, we set (and send) an expiration date in the HT…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question