Jump to content
isaque.almeida

Help with validation Dates using JavaScript

Recommended Posts

Hi all.

I developed a JavaScript function to prevent that call_back_date field be less than alg.time_stamp date (activity date). Date is in format DD/MM/YYYY

The problem is that it's seems like comparing if the day of call back date is greater than day of activity date. Even if the month is greater, if the day is minor it's considering call back less than activity date.

I attached a screenshot with an example. I appreciate any help that let me to solution.

Thanks and regards.

 

function zValidateSchedDate(){

    
    var zStartDate, zSchedDate;
    var zSatus = document.main_form.elements["SET.status"].value;
    
         zStartDate = document.main_form.elements['SET.alg.time_stamp'].value;
        zSchedDate = document.main_form.elements['SET.call_back_date'].value;
        
        if((zSchedDate <= zStartDate) && (zSatus == "atdschedule")){
            zDisplayMessage("Schedule date needs to be a future date!");
            return false;
        }else{
            return true;
        }
}

 

 

callbackdate.png

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...