Home » Developer & Programmer » Forms » HOW TO RESTRICT TEXT ITEM INPUT (ORACLE DEVELOPER 6I, WINDOWS XP)
icon4.gif  HOW TO RESTRICT TEXT ITEM INPUT [message #426649] Sun, 18 October 2009 00:24 Go to next message
fci_mohamed
Messages: 5
Registered: October 2009
Location: egypt
Junior Member

HELLO 4 ALL,
I'M A NEW MEMBER IN THIS FORUM.
I HAVE SOME PROBLEM SUMARIZED AS FOLLOWING :
I HAVE TEXT ITEM ITS DATATYPE IS CHAR, I WANT THIS TEXT TO ACCEPT ONLY CHARACTER FROM a-z, A-Z ONLY, AND IF USER TRY TO TYPE ANY OTHER CHARACTER LIKE NUMBERS OR SPECIAL CHARACTERS THE SYSTEM DON`T ACCEPT THIS TRY.
NOTE: I WANT TEXT DON`T WRITE THIS CHAR ORIGINALLY NOT TYPE THEN CHECK AND REMOE UNWANTED CHARACTER .
THANKS FOR ALL
Re: HOW TO RESTRICT TEXT ITEM INPUT [message #426675 is a reply to message #426649] Sun, 18 October 2009 15:34 Go to previous messageGo to next message
Littlefoot
Messages: 20888
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
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 between
SQL> 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 #426685 is a reply to message #426649] Sun, 18 October 2009 23:40 Go to previous messageGo to next message
Jason8Pang
Messages: 4
Registered: March 2009
Junior Member
I agree with Littlefoot's idea.
hi fci_mohamed ,you try it.
Re: HOW TO RESTRICT TEXT ITEM INPUT [message #426686 is a reply to message #426675] Mon, 19 October 2009 00:24 Go to previous messageGo to next message
fci_mohamed
Messages: 5
Registered: October 2009
Location: egypt
Junior Member

Thank u for your interest,
I try this process before and work as required, but i want if the user try to type for example character(;),text item don`t accept this trying, not wait until the user finish inputing process then check entered string.
I want the process of check to be performed char by char entered.
Thanks for u again.

[EDITED by LF: disabled smilies and changed font case from UPPERCASE to Sentence case]

[Updated on: Mon, 19 October 2009 03:23] by Moderator

Report message to a moderator

Re: HOW TO RESTRICT TEXT ITEM INPUT [message #426729 is a reply to message #426686] Mon, 19 October 2009 03:24 Go to previous messageGo to next message
Littlefoot
Messages: 20888
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
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 #426753 is a reply to message #426729] Mon, 19 October 2009 07:10 Go to previous messageGo to next message
fci_mohamed
Messages: 5
Registered: October 2009
Location: egypt
Junior Member

thanks for interesting.
your note is taken into consedration.
Re: HOW TO RESTRICT TEXT ITEM INPUT [message #426947 is a reply to message #426753] Tue, 20 October 2009 06:46 Go to previous messageGo to next message
athar.fitfd@hotmail.com
Messages: 193
Registered: October 2007
Location: pakistan
Senior Member
This functionality can be achieved by using Timer control.
Re: HOW TO RESTRICT TEXT ITEM INPUT [message #426964 is a reply to message #426947] Tue, 20 October 2009 07:28 Go to previous messageGo to next message
cookiemonster
Messages: 12403
Registered: September 2008
Location: Rainy Manchester
Senior Member
athar.fitfd@hotmail.com wrote on Tue, 20 October 2009 12:46
This functionality can be achieved by using Timer control.


Really?

How?
Re: HOW TO RESTRICT TEXT ITEM INPUT [message #427697 is a reply to message #426964] Sat, 24 October 2009 02:19 Go to previous messageGo to next message
wency
Messages: 450
Registered: April 2006
Location: Philippines
Senior Member

This has been discussed here for so many times.. using timer to achieve validation similar to VB key-press. search it.
Re: HOW TO RESTRICT TEXT ITEM INPUT [message #430100 is a reply to message #426964] Sun, 08 November 2009 06:03 Go to previous messageGo to next message
fci_mohamed
Messages: 5
Registered: October 2009
Location: egypt
Junior Member

thanks for all,
but how use timer i try it but it work one time only.
thanks again
Re: HOW TO RESTRICT TEXT ITEM INPUT [message #430190 is a reply to message #430100] Mon, 09 November 2009 07:04 Go to previous messageGo to next message
javed.khan
Messages: 340
Registered: November 2006
Location: Banglore
Senior Member

Gents ,


This timer for predictive text sounds great topic anybody have links or anything abut it... i really cant wait to try this .


Jak
Re: HOW TO RESTRICT TEXT ITEM INPUT [message #431110 is a reply to message #430190] Sun, 15 November 2009 01:49 Go to previous messageGo to next message
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 Go to previous messageGo to next message
javed.khan
Messages: 340
Registered: November 2006
Location: Banglore
Senior Member

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
Re: HOW TO RESTRICT TEXT ITEM INPUT [message #432470 is a reply to message #426649] Tue, 24 November 2009 06:32 Go to previous messageGo to next message
coolbunny111
Messages: 12
Registered: June 2009
Junior Member
There is alternate way to do is open property palette of text_item
and set its Data type to Alpha.


Re: HOW TO RESTRICT TEXT ITEM INPUT [message #433374 is a reply to message #432470] Wed, 02 December 2009 00:11 Go to previous message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
Use a Java thingy to do the foreground validation.

David
Previous Topic: Developer 6i Installation Problem
Next Topic: tree in oracle 6i
Goto Forum:
  


Current Time: Fri Dec 02 16:32:45 CST 2016

Total time taken to generate the page: 0.55927 seconds