简体   繁体   中英

How do I add validation to text area in oracle apex

I am feed up with this Oracle APEX application , their is no proper videos or documentation

I have a Text area field and button

On button click I have written a PL/SQL code to send mail

Is their any way I can populate error / success message on screen

If text area is empty does not have any data then display error message on screen as Text area field is empty

My code :

BEGIN
    if (:textarea1 is not null ) then
           APEX_MAIL.SEND(p_from => 'alice@example.com',
                   p_to   => 'bob@example.com',
                   p_subj => 'Email from Oracle Autonomous Database',
                   p_body => 'Sent using APEX_MAIL');
    else
               --popup error message on my screen -> `textarea` filed cannot be empty 
    end if;   
END;

The following package of ADD_ERROR.ADD_ERROR does not exist at my end

If text area is empty does not have any data then display error message on screen

You don't need your own validation for that; just set that item's Value required property ON.


Additionally, you can even set process' Server side condition to

  • When button pressed: pick the button you use to send an e-mail
  • Type: Item is not null; pick the text area item

You commented that it isn't working. Well, it is. If it doesn't for you, then you did something wrong (although, I can't imagine what would that be, regarding the fact that it is just one property you had to set).

So: if I leave the text area empty and push the button, error message is here:

在此处输入图像描述

As of a video with demonstration : I don't have any. Google for it, if you desperately need it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM