|
| Re: HOW TO RESTRICT TEXT ITEM INPUT [message #426675 is a reply to message #426649] |
Sun, 18 October 2009 15:34   |
Littlefoot Messages: 9245 Registered: June 2005 Location: Croatia, Europe |
Senior Member |
|
|
Write a WHEN-VALIDATE-ITEM trigger which will loop through all characters that have been entered. Check every character's ASCII value. Those values should be betweenSQL> select ascii('A'), ascii('Z') from dual;
ASCII('A') ASCII('Z')
---------- ----------
65 90
SQL>
In order to make it simple, first change the input string to upper case (use UPPER function).
|
|
|
|
|
| Re: HOW TO RESTRICT TEXT ITEM INPUT [message #426729 is a reply to message #426686] |
Mon, 19 October 2009 03:24   |
Littlefoot Messages: 9245 Registered: June 2005 Location: Croatia, Europe |
Senior Member |
|
|
Forms itself is incapable of doing that (fetching characters as you type). In order to perform such a validation, you'll need to implement Java code.
Also, please, do not type your messages in upper case.
|
|
|
|
|
|
|
|
|
| Re: HOW TO RESTRICT TEXT ITEM INPUT [message #431110 is a reply to message #430190] |
Sun, 15 November 2009 01:49   |
fci_mohamed Messages: 5 Registered: October 2009 Location: egypt |
Junior Member |
 
|
|
hello 4 all,
i partially solved the problem as following:
1- write this code in the WHEN-NEW-ITEM-INSTANCE trigger
DECLARE
SEC_TIMER TIMER;
ONE_SECOND NUMBER :=1000;
F_TIMER TIMER;
BEGIN
F_TIMER := FIND_TIMER('ALARM');
SEC_TIMER := CREATE_TIMER('ALARM',ONE_SECOND,REPEAT);
END ;
2- write this code in WHEN-TIMER-EXPIREDtrigger
DECLARE
TEMP VARCHAR2(1);
TEMP1 VARCHAR2(25);
CURR_VALUE VARCHAR2(1);
N NUMBER;
SEC_TIMER TIMER;
BEGIN
FOR I IN 1..LENGTH(:LOC)
LOOP
TEMP := SUBSTR(:LOC,I,1);
CURR_VALUE := TEMP;
IF (ASCII(CURR_VALUE) NOT BETWEEN 65 AND 90)
AND (ASCII(CURR_VALUE) NOT BETWEEN 97 AND 122) THEN
TEMP1 := REPLACE(:LOC,CURR_VALUE);
:LOC := TEMP1;
SET_TIMER('ALARM',100,REPEAT);
END IF;
END LOOP;
END;
3- write this code in POST-TEXT-ITEM trigger
DELETE_TIMER('ALARM');
this code is already tried and work properly, but there is some problem that if u type in text item first time it work and no errors occured but if u try to type another time as to edit data in this text and erased all data in the text box this code will not work as previously, could any one help me to solve this problem?
thanks 4 all...
|
|
|
| Re: HOW TO RESTRICT TEXT ITEM INPUT [message #431111 is a reply to message #431110] |
Sun, 15 November 2009 01:59   |
|
Hey FCI
Quote:try to type another time as to edit data in this text and erased all data in the text box this code will not work
I tried two three times its working tell me the exact walkthrough where its not working.
JAK
|
|
|
|