Invalid date - getting an error message on the form

Hi
I am using APEX version 3...
in my form I have a date field (with date picker option)... my users can pick the date with no issues... the issue is when my user enters manually (usually by mistake) something in the date field.... I get the following error message when the date is invalid
ORA-01840: input value not long enough for date format
I know in version 4 of APEX we can use dynamic action or validation function... is there an option to use in Version 3...?
thanks

Hi,
Create a Validation....
Name: Valid Date
Type: Function Returning Boolean
Validation Expression 1:
DECLARE
my_date DATE;
BEGIN
IF LENGTH (:P1_DATE) = 11
THEN
my_date := TO_DATE (:P1_DATE, 'DD-MON-YYYY');
RETURN TRUE;
ELSE
RETURN FALSE;
END IF;
EXCEPTION
WHEN OTHERS
THEN
RETURN FALSE;
END;
Error Message: Date is not a valid date!
Associated Item: P1_DATE
Condition Type: Value of Item in Expression 1 Is NOT NULL
Expression 1: P1_DATE
Regards,
Kartik Patel
http://patelkartik.blogspot.com/
http://apex.oracle.com/pls/apex/f?p=9904351712:1

Similar Messages

Maybe you are looking for

  • How to change field text at  run time in alv

    Hi all, Following are the columns need to displayed in an alv. year shd be the year which was entered in the selection screen. if the year entered was between 2001 and 2003 then the o/p(for year)  shd be as follows Division/Name     Position     Mana

  • Seeking 'offline' workflow advice

    Hi. I'm presently sorting through 35,000 photos in my main catalog based on my desktop Mac with the relevant drives. It's a long process that I'm doing over the span of many weeks and I'd like to be able to change places in the house when I do this.

  • When I place a call the caller cannot here me. Also when I speak the sound is coming back to me is my ear

    When I Place a call the caller cannot hear me,also when I speak the sound is coming back in my ear.

  • E71 hanging - Menu function does not work

    I bought an E71 from the Nokia store 4 weeks ago and have had it replaced thrice already. The phone suddenly hangs and the Menu key stops working. At the same time it also stops automatic retrieval of email. Other dedicated keys work. The Nokia store

  • Configuration of stock transfer order

    Dear All,           Can anybody tell me the detail configuration of stock transfer order process between two plants within same company code ?                                                                                 with regards,