Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Another js question

Posted on 2004-03-25
5
Medium Priority
?
249 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 1400 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Problem "Can you help me recover my changes?  I double-clicked the attachment, made changes, and then hit Save before closing it.  But when I try to re-open it, my changes are missing!"    Solution This solution opens the Outlook Secure Temp Fold…
Sometimes clients can lose connectivity with the Lotus Notes Domino Server, but there's not always an obvious answer as to why it happens.   Read this article to follow one of the first experiences I had with Lotus Notes on a client's machine, my…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

715 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