Re: forms 5.0 How to limit text item size at runtime.

From: <tas02_at_my-deja.com>
Date: Wed, 25 Oct 2000 13:51:23 GMT
Message-ID: <8t6ogo$956$1_at_nnrp1.deja.com>


Unfortunately, you can't set the MAX_LENGTH property, so you'll need to do something like this:

Given a Block named "block1" containing two items "size" and "chrfld", create a procedure called "PR_CHECK_SIZE":

   PROCEDURE pr_check_size is
   begin

     if length(:block1.chrfld)>nvl(:block1.size,0) then
         message('Error: Max size is '||
                 to_char(nvl(:block1.size,0)));bell;pause;
         raise form_trigger_failure;
     end if;

   END; Now create a WHEN-ITEM-VALIDATED trigger on both the SIZE field and the CHRFLD field containing a call to PR_CHECK_SIZE. Crude, but it works.

Anyone else got a better way?

HTH. Tom Sullivan

In article <8t484r$k0a$1_at_news.worldcom.ch>,   "Olivier" <slump74_at_hotmail.com> wrote:
> Hello,
> I want to limit the max size of a text item at runtime.
> For exemple, user select a size of ten in the first item and the maxe
 size
> of the second would become 10 so that the user can't enter more that
 ten
> char in it.
> If you have any idea on how to do that your help is welcome.
> Olivier.
>
>

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Wed Oct 25 2000 - 15:51:23 CEST

Original text of this message