2 Replies Latest reply: Sep 20, 2010 3:10 PM by 690743 RSS

    Raise form_trigger_failure

    690743
      Hii,,

      on my Login form i have 2 fields, LOGIN_ID and PWD.

      i have written When-Validate-Item for both the fields.
      Whats happening is, that if user enters a wrong LOGIN_ID, the cursor remains in the login field,
      because of the RAISE form-trigg-faliure statement and that is correct...
            LOGIN_ID-WVI
      declare 
           cursor c_user is select 'x' 
           from   user_master
           where  user_NAME = :m_user;
      
           m_dummy varchar2(1);
      begin
           open  c_user;
           fetch c_user into m_dummy;
           if    c_user%notfound then
           message('User not found..!!!');
           message(' ');
           raise form_trigger_failure;
           end if;
           close c_user;
      end;
      when user enters wrong password, it does the same, remains in the PWD field because of the
      RAISE form-trigg-failure. Now i want to give user a chance to change/enter with an another LOGIN_ID.
      It is not allowing to go back to the LOGIN_ID field by either using SHIFT-TAB or thru use of mouse.
             PWD-WVI
      DECLARE
      
      M_pwd VARCHAR2(12);
      cursor c_pwd is select user_pwd
                from   user_master
                where  user_pwd = :pwd
                and    user_name = :m_user;
      BEGIN
                open c_pwd;
                fetch c_pwd into m_pwd;
                close c_pwd;
                if  m_pwd = :pwd then
                      :pwd := null;
               else
                message('Incorrect Password..!');
                      message('');
                      :pwd:='';
                      RAISE FORM_TRIGGER_FAILURE;
               end if;
      END;
      The cursor remains in the PWD field only, expecting user to enter correct password for the LOGIN_ID entered just before
      or the user had to quit the application.

      Please suggest..TY
        • 1. Re: Raise form_trigger_failure
          CraigB
          Forms is not allowing the cursor to move because there is still a value in the PWD field. In order to move the cursor you will need to clear the block or the form with the Clear_Form(NO_VALIDATE) or Clear_Block(NO_VALIDATE) built-ins.

          It is standard programming practice that when a User ID or PW has been entered incorrectly, that both the ID and PW fields are cleared and a generic message, such as "Login information was entered incorrectly" displayed versus "User not found" or "Incorrect Password." The reason for this is that if someone is attempting a "Brute Force" attack, to log into your application, they don't know which element of the credentials is invalid. By telling the user their ID or PW is invalid helps the "Brute Force" attacker. :)

          In any case, clearing the form or the block will allow the user to reenter their credentials.

          Hope this helps,
          Craig B-)

          If someone's response is helpful or correct, please mark it accordingly.
          • 2. Re: Raise form_trigger_failure
            690743
            thanks Craig..

            clear block worked just fine..