Date Validation (MM/DD/YYYY)

Hey,
I need Date Validation.
I need to restrict wrong entry of date & previous date also. This can be done either through entry or after clicking on Submit i need to check weather the entered date is valid and it is equal to or after today's date.
Date Format: MM/DD/YYYY.
I need this very urgently. Helpful answer is highly rewarded with Points.

Hi Sankar,
Try this:
Go to Object Palette and Binding Tab. Specify Data Patter MM/DD/YYYY (if not found in dropdown you may simply type it)
Go to Cell Tab and specify Display Pattern = MM/DD/YYYY and Edit Pattern as MM/DD/YYYY
Now write a script to validate that the entry is correct..
Select Exit Event.. Language FormCalc
// to check format
var v_dt = $.rawValue
if (v_dt <> "") then
  var v_dtnm = Date2Num(v_dt, "MM/DD/YYYY")
  if (v_dtnm == 0) then
    xfa.host.messageBox("Enter date in MM/DD/YYYY format")
  else //check if date is GE current date
    var v_currdt = Date()
    if (v_currdt > v_dtnm) then
      xfa.host.messageBox("Enter Date Greater tahn or equal to today's date")
    endif
  endif
endif
Regards,
Reema.

Similar Messages

  • Adobe forms date Validation

    In webdynpro application am using interactive forms .
    In that i have a Date field. i want the user to type only in the (DD-MMM-YYYY). it should not allow the other formats.
    if he enters any other format it should say an error message and should clear the date field

    Hi
    Place the following code in the validate method. This is formcalc code
    var num = IsoDate2Num($.rawValue) - Date()
    if ( num < 0 ) then
    $host.messageBox("Invalid Date")
    $.rawValue = ""
    else
    $host.messageBox("Do whatever")
    for more check this thread
    Re: Date Validation (MM/DD/YYYY)
    Re: Adobe Forms - Locale and date format
    thanks

  • Date validation in " DD-MON-YYYY"

    Hi ,
    I have created a textbox with date picker as (dd-mon-yyyy) .
    Now i want to create a validation on it for the format (dd-mon-yyyy) .
    I have created a pl/sql code with type "function returning error text".
    Begin
    If :P4_END_DATE IS NOT NULL THEN
    if :P4_END_DATE != to_date(:P4_END_DATE ,'DD-MON-YYYY') then
    return 'END DATE should be in "DD-MON-YYYY" Format';
    end if;
    END IF;
    End;
    When i type in like 20-NOV-08 it gives error as 'START DATE should be in "DD-MON-YYYY" Format',
    but when i change month like 20-11-2008 , it actually gives error
    ORA-01843: not a valid month
    Error ERR-1024 Unable to run "function body returning text" validation.
    Edited by: Vaibss on Nov 25, 2008 2:09 AM
    Edited by: Vaibss on Nov 25, 2008 2:10 AM

    Hello,
    Duplicate post -
    Date validation in "DD-MON-YYYY" Format,
    John.
    Blog: http://jes.blogs.shellprompt.net
    Work: http://www.apex-evangelists.com
    Author of Pro Application Express: http://tinyurl.com/3gu7cd
    REWARDS: Please remember to mark helpful or correct posts on the forum, not just for my answers but for everyone!

  • Date validation

    Hi ,
    I have a created an textbox with date picker as (dd-mon-yyyy) .
    Now i want to create a validation on it for the format (dd-mon-yyyy) .
    I have created a pl/sql code with type "function returning error text".
    Begin
    If :P4_END_DATE IS NOT NULL THEN
    if :P4_END_DATE <> to_date(:P4_END_DATE ,'DD-MON-YYYY') then
    return 'END DATE should be in "DD-MON-YYYY" Format';
    end if;
    END IF;
    End;
    When i type in like 20-NOV-08 it gives error as 'START DATE should be in "DD-MON-YYYY" Format',
    but when i change month like 20-11-2008 , it actually gives error
    ORA-01843: not a valid month
    Error ERR-1024 Unable to run "function body returning text" validation.

    Hello,
    You have duplicated this post, see my answer here -
    Re: Date validation in "DD-MON-YYYY" Format,
    John.
    Blog: http://jes.blogs.shellprompt.net
    Work: http://www.apex-evangelists.com
    Author of Pro Application Express: http://tinyurl.com/3gu7cd
    REWARDS: Please remember to mark helpful or correct posts on the forum, not just for my answers but for everyone!

  • How to Insert date in 'DD/MM/YYYY' format in oracle using stored procedure?

    Hi
    How to Insert date in 'DD/MM/YYYY' format in oracle using stored procedure?
    This is my Input data.
    11/25/2007.
    By using below query, it is inserted into database.
    sql>Insert into tblname values(to_date('11/25/2007','MM/DD/YYYY'));
    But using stored procedure, the same query is not running.
    It shows error like
    ORA-01843: not a valid month ORA-06512: at line 1
    Procedure:
    create or replace procedure Date_Test(datejoin in DATE) is
    begin
    insert into datetest values(to_date(datejoin,'MM/DD/YYYY'));
    end Date_Test;
    I had used 'nls_date_language = american' also.
    Prcodeure is created but not worked in jsp. The same error is thrown.
    Pls provide a solution

    This might help you....
    SQL> Create Table DateTest(col1 Date);
    Table created.
    Elapsed: 00:00:00.00
    SQL> create or replace procedure Date_Test(datejoin in DATE) is
    2 begin
    3 insert into datetest values(to_date(datejoin,'MM/DD/YYYY'));
    4 end ;
    5 /
    Procedure created.
    Elapsed: 00:00:00.00
    SQL> exec Date_Test('11/25/2007');
    BEGIN Date_Test('11/25/2007'); END;
    ERROR at line 1:
    ORA-01843: not a valid month
    ORA-06512: at line 1
    Elapsed: 00:00:00.00
    SQL> exec Date_Test(To_Date('11/25/2007','mm/dd/yyyy'));
    BEGIN Date_Test(To_Date('11/25/2007','mm/dd/yyyy')); END;
    ERROR at line 1:
    ORA-01843: not a valid month
    ORA-06512: at "CTBATCH.DATE_TEST", line 3
    ORA-06512: at line 1
    Elapsed: 00:00:00.00
    SQL> create or replace procedure Date_Test(datejoin in DATE) is
    2 begin
    3 insert into datetest values(datejoin);
    4 end ;
    5 /
    Procedure created.
    Elapsed: 00:00:00.00
    SQL> exec Date_Test(To_Date('11/25/2007','mm/dd/yyyy'));
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.00
    SQL> Select * from DateTest;
    COL1
    25-NOV-07
    Elapsed: 00:00:00.00
    SQL> create or replace procedure Date_Test(datejoin in VarChar2) is
    2 begin
    3 insert into datetest values(to_date(datejoin,'mm/dd/yyyy'));
    4 end ;
    5 /
    Procedure created.
    Elapsed: 00:00:00.00
    SQL> exec Date_Test('11/25/2007');
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.00
    SQL> select * from DateTest;
    COL1
    25-NOV-07
    25-NOV-07
    Elapsed: 00:00:00.00
    SQL>

  • How to get date in dd/mm/yyyy format ?

    Hello,
    for this query :
    >select to_date(to_char(sysdate),'dd/mm/yyyy') from dual;
    i wanted to get date in dd/mm/yyyy format , but this query is not returning in correct date format .
    How to get that ?

    select id,
    to_date(to_char(dt1,'mm/dd/yyyy'),'dd/mm/yyyy') dt1,
    to_date(to_char(dt2,'mm/dd/yyyy'),'dd/mm/yyyy') dt2
    from t_table1 where no=23;This is my actual query.
    But this query is giving error.
    ORA-01843: not a valid monthWhen i issued this query :
    select id,dt1,dt2 from t_table1 where no=23 ;
    this is the output :
    ID DT1 DT2
    001 10/7/2011 10/19/2011Edited by: bootstrap on Oct 8, 2011 2:13 PM
    Edited by: bootstrap on Oct 8, 2011 2:13 PM

  • Date Validation problem in form with report

    Hi,
    I am stuck on this date validation issue in a form with report that I am working on-
    I have an Active_date_start and an Active_date_end field. I want to validate the form in such a way that if the user enters the Active_date_end < active_date_start then it should error out appropriately asking to change the active_end_date . Also another problem is that the changes are made to the active_date_end they should reflect in the table. How do I accomplish this.
    Appreciate all the help offered.
    Thanks.

    Hi,
    Thanks for the code.Now the APPLY CHANGES works fine except that it throws an error when I change the end date to a date which is less than the start date . So it does show me my error and does not go further but also shows me the error -
    Invalid PL/SQL expression condition: ORA-06550: line 1, column 29: PLS-00306: wrong number
    or types of arguments in call to 'NVL' ORA-06550: line 1, column 7: PL/SQL: Statement
    ignored Invalid PL/SQL expression condition: ORA-06550: line 1, column 29: PLS-00306:
    wrong number or types of arguments in call to 'NVL' ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    I looked up the error number and it says its a generic error type where the error can be found on the line number specified. But in this case how and where do I look for the error line?. This is the code I am using-
    DECLARE
    vACTIVE_DATE_START DATE;
    vACTIVE_DATE_END DATE;
    BEGIN
    vACTIVE_DATE_START := TO_DATE(:P4_ACTIVE_DATE_START, 'DD/MM/YYYY');
    vACTIVE_DATE_END := TO_DATE(:P4_ACTIVE_DATE_END, 'DD/MM/YYYY');
    IF vACTIVE_DATE_END < vACTIVE_DATE_START THEN
    RETURN 'End date is before start date';
    ELSE
    RETURN NULL;
    END IF;
    END;
    My base table has the active_date_start as NOT NULL. Now I have the exact same code for APPLY CHANGES
    in other form and it works fine not giving the above error. I am at a loss to know how I can get rid of the error.
    Any suggestions!.
    Thanks in advance,
    A

  • Need to make date validation to remove overlab

    I have a problem in date validation
    I will tell you the scenario
    I have department table as a master table and under this department there is some teachers.
    Eeach teacher have Start Hiring Date and End Hiring Date .
    I want to prevent to insert a new teacher with Start Hiring date or End hiring date between any period inserted before in this department .
    This means in any period there is only one hired teacher
    how can I do this validation

    Assumed that you are using ADF BC, I reproduced your use case, and tried this. you can also try it,
        CREATE TABLE test_department
        (      id      numeric(10)      not null,
             name      varchar2(50) not null,
             CONSTRAINT dpt_pk PRIMARY KEY (id)
        CREATE TABLE teachers
        (      id      numeric(10) PRIMARY KEY     ,
             dept_id      numeric(10)      not null,
              start_date date,
              end_date date,
             CONSTRAINT fk_emp  FOREIGN KEY (dept_id)
               REFERENCES test_department(id)
    insert into test_department values (1,'Math');
    insert into teachers values(1,1,to_date('1/1/2010','DD/MM/YYYY'),to_date('31/12/2010','DD/MM/YYYY'));add a validate entity method to you TeacherImpl class.
        public boolean validateTeachers()
            TestDepartmentImpl deptImpl = this.getTestDepartment(); // TestDepartment is the accessor name exposed in TeachersImpl class
            RowIterator iter = deptImpl.getTeachers(); //Teachers is the accessor name exposed in DepartmentImpl class
            boolean flag = true;
            while (iter.hasNext())
                    TeachersImpl currentTeacher = (TeachersImpl)iter.next();
                    if (!currentTeacher.getId().equals(this.getId())) //skip the current teacher from comparison
                        if (this.getStartDate().compareTo(currentTeacher.getStartDate()) >
                            0 && this.getEndDate().compareTo(currentTeacher.getEndDate())<0)
                              flag=false;
            return flag;
        }

  • Date Validation - a Nightmare for ME!

    Hi, I searched the forum and came up with some code that works for me partially. I am still having problems with getting the end result that is needed.
    I need to do a date validation where the begin date is less than end date. Below is the syntax..It works but when I put in the correct end date i still get the error message athough the date is correct. Also if I set the focus back to the field and correct the date it still set focus back... I'm sure it is something simple that I am missing
    ----- form1.subformpage1.empnsubform.DateTimeField2::exit - (JavaScript, client) -------------------
    if (DateTimeField2.formattedValue>=DateTimeField1.formattedValue);
    xfa.host.messageBox("Incorrect Date range");
    What am I missing? Yes I still struggle with writing scripts!!!!
    thanks

    I have a similar thing on one of my forms, the fields are "Date Submitted" and "Date Needed" and I need to validate that the Date Submitted date occurs before the Date Needed date.  If it does not, it prompts a response dialog box and asks for a new DateNeed to be entered.  Here is the code I used: (I'm by no means an expert at code)<br /><br />//This just sets the values of the date/time fields to variables, and then checks for a null value.  If null, it changes the rawValue to an empty string for inserting into database.  If not null, it leaves the existing rawValue unchanged. Unless you're writing info to a database, you probably wouldn't need this.<br /> <br />var DateSubmit = form1.MainForm.Info.DateSubmitted.rawValue == null ? "" : form1.MainForm.Info.DateSubmitted.rawValue;<br />var DateNeed = form1.MainForm.Info.DateNeeded.rawValue == null ? "" : form1.MainForm.Info.DateNeeded.rawValue;<br /><br />if (DateNeed<DateSubmit)<br /><br />{<br /><br />     var dateResponse = xfa.host.response("The Date Needed date must be later than the Date Submitted date.\nPlease enter new date below: (MM/DD/YYYY format)", "Date Needed Error");<br /><br />     var myDate = new Date(dateResponse);<br /><br />     var myFormattedDate = util.printd("dd mmm yyyy", myDate);<br /><br />     form1.MainForm.Info.DateNeeded.formattedValue = myFormattedDate;<br /><br />}<br /><br />BTW, I have this as code on a submit button that does all of my validations and then writes a new record to a database.  But I think you could also do this on the exit event of the second date/time field if needed. The variable declarations at the top would be slightly different.<br /><br />Lynne

  • Please enter the expiry date in dd.mm.yyyy format

    Dear All,
    I have configured SAP AA in Dev. Now I want to craete asset master. But it is showing the following error, when I am going to save:
    Please enter the expiry date in dd.mm.yyyy format
    Can anyone tell me the solution?
    Thanks
    Azimul

    Thanks Jigar for your reply.
    My company is using SAP last 2.5 years. During SAP Implementation, Consultants configured SAP AA, but during testing it showed error in Asset Accounting. That is why, we donu2019t use SAP AA.
    Now we want to use Asset Accounting in SAP. I have configured SAP AA in Development. Then I try to Create Asset Master, But it is showing Error:
    Please enter the expiry date in dd.mm.yyyy format
    I cannot get Error message no also. If I double click on error, it is not opening.
    I donu2019t know about Validations. Can u please guide me?
    Thanks,
    Azimul
    Edited by: Azimul on Oct 1, 2011 7:58 AM

  • Date validation with minValue on 1st February

    Here is my validation on a textfield which expect a date :
    var dateValidation = new
    Spry.Widget.ValidationTextField("dateValidation", "date",
    {isRequired:false, format:"dd/mm/yyyy", validateOn:["blur"],
    minValue:"31/01/2008", useCharacterMasking:true});
    Test with these parameters :
    Today date : 31/01/2008
    Try to enter 01/02/2008 and this date is detected as a date
    in the past.
    You can do the same with each year: try to put your today
    date on 31/01/2009 and enter 01/02/2009...
    Is it a bug from Spry?

    I debug the "SpryValidationTextField.js" and I found a bug in
    the date validation function.
    In javascript, when you create a new date, the month is on
    base "0".
    So when your month is January and the value typed is 1. If
    you would like to create a new date based on this month, you have
    to specified the month "0".
    Adobe Spry Team,
    could you correct the line :
    return (new Date(theYear, theMonth, theDay);
    by:
    return (new Date(theYear, theMonth - 1, theDay);

  • Insert Date in  mm/dd/yyyy

    This is the value I am inserting in the DB
    to_char(g.ship_date,'DD-MON-YYYY'),
    When I run from my desktop through TOAD Its fine. when run in another environment it gives error "Not a valid month"
    I am just trying to format the date in 'DD-MON-YYYY'

    Use Trim(g.ship_date)Not TRIM - it works with character data and trims leading/trailing/both
    specific characters in the string.
    Trunc() is that:
    SQL> select trunc(sysdate) from dual;
    TRUNC(SYSDATE)
    26-OCT-2005 00:00:00Rgds.

  • Need help in date Validation Urgent

    Hi ,
    We need help in Date Validation.
    we have 2 Date fields on the form Start Date, End Date
    The requirement is: End Date (May not be greater than 30 years from the start date).
    I have written following script on End Date Exit event. But the problem is its calculating 30 years from the Current Date not from the Start Date
    var tDate = util.scand("mm/dd/yyyy", new Date());
    var M = tDate.getMonth();
    var D = tDate.getDate();
    var Y = tDate.getFullYear();
    var SRes = util.printd("yyyy-mm-dd", new Date((Y+30), M,D) );
    //app.alert(SRes)if (SRes <= this.rawValue){
    app.alert("May not be greater than 30 years from the start date")
    xfa.host.setFocus(
    this);}
    can someone please help me
    Regards,
    Jay

    Hi,
    You'll need to get javascript date from LCD field, and calculate & compare with the future date in javascript date.
    try following script;
    var sDate = StartDate.rawValue;
    var wkStartDate = util.scand("yyyy-mm-dd", sDate);
    var nYear = wkStartDate.getFullYear();
    var nMonth = wkStartDate.getMonth();
    var nDay = wkStartDate.getDate();
    var wkFutureDate = new Date(nYear  + 30 , nMonth, nDay);
    sDate = EndDate.rawValue;
    var wkEndDate = util.scand("yyyy-mm-dd", sDate);
    if (wkEndDate.getTime() > wkFutureDate.getTime()){
      xfa.host.messageBox("May not be greater than 30 years from the start date");
      xfa.host.setFocus(this);

  • Date validation question

    Hey all,
    I have a form which allows the user to select a month, day, and year for an order. Each (mm/dd/yyyy) are individual menu selects.
    Is there a way to validate that what they enter is greater than today's date? I might be able to do this with javascript but if there is a way to do it with jsp, that'd be great.
    thanks!!!

    HI,
    U can use the SimpleDateFormat for the date validation in JSP or servlets.
    This SimpleDateFormat gives a easy methods to date-validations.
    Regards
    Madhavan C

  • Date Validation Error

    I'm currently using the DD-MON-YYYY format for my program. The item is for a Date of Birth, and I'm using a date picker to get the information. The problem I'm running into is that If someone types a date into the box (say 2/2/2009) instead of using the date picker, it is throwing an invalid month error (I'll come back to that part in a minute). My first question is this, is there anyway to set a Date Picker item to not allow people to type into it so that they HAVE to use the selector?
    If that's not possible, then it brings up the other problem that I brought up. The invalid month error. I believe that what's causing the problem is my validation. I'm running a check to make sure that the DAte of Birth does not occur in the future. To do this, I'm running a PL/SQL Returns Boolean script. This script runs, and runs correctly, if the date picker is used to input the date, but if you type in the date using a different format, then it throws the error. The code that I'm using is this:
    DECLARE
    WHO DATE;
    HOW DATE;
    BEGIN
    HOW := SYSDATE;
    WHO := :P3_DATE_OF_BIRTH;
    IF WHO > HOW
    THEN
    RETURN FALSE;
    ELSE
    RETURN TRUE;
    END IF;
    END;
    Any help in pointing out what I'm missing in why the code isn't runnig correctly is more than greatly appreciated. Thanks.
    Josh

    Thanks for all of the input. The way I have the validations setup is that I have three just for the date field. The first checks if it is null or not, the second checks whether it is a valid date (using the option in Apex itself), and the third one checks whether it occurs in the past or not. The thing is that it is hitting the future check and giving me an invalid date error (I tried putting in gggggg as the date, and it somehow got past the valid date validation.) and threw the invalid date error on the future check. I don't know if this changes anything or not, but I'm certainly not giving up yet.

Maybe you are looking for

  • Calculation of tax on Basic amount is wrong in PO

    hi frends, we have made a SERVICE PO with following details : basic price : 332000/- in invoice tab service tax : 10.3 % according to this the tax on PO should be 34196 but in condition tab for this item it is showing tax = 38965.81 where could be th

  • RAC CRS not getting started

    Hi, We had installed RAC DB namely ORCL on a two-node cluster abcoracledb01 and abcoracledb02 with the OUI launched from db01 node. After installation, the NETCA is able to identify the RAC DB ORCL on both the nodes as well as the ORCL1 instance on d

  • Info msg from deployment of app

    Deploying app from Creator on Windows XP to Sun Java System Web Server 6.1SP6 Solaris SPARC How to resolve this?? (even though the app runs) Is there a missing library (jar) file?? [17/Jul/2007:15:16:00] info ( 9888):      for host 111.222.333.444 tr

  • Sharing a network connection with an Ipad2

    I have a windows desktop connected to a network. I'd like to share the network connection with my Ipad while it is connected via the USB cable to the desktop. Is this possible? How? Thanks, Shaun

  • Driver for my camcorder

    Hi, everybody. I have a DCR-PC105 camcorder, and I haven't found the driver for mac, I've searched and I only found for Windows. Would you help me, pleaseee!!!!