Text item validation into Formular.

hi.
From some days I have written my fiirst application using Oracle Forms6i.
In oracle9i I created table USER with column id_user number(5), username varchar2(10) and passwd varchar2(12).
In oracle forms builder I created the formular with 4 controls(2 fields - username and passwd ,one button to login user and Text item to the botton of this formular to print message for user). In ProperPalette for Text item 'username' and 'passwd' I set adequately Maximum Lenght peperty to 10 and 12(for 'passwd' field) and Required to Yes.
Then I wanted to make a validation username and passwd fields in this way, that the user can put in 'username' field the string with length between 8 to 10 and for 'passwd' between 8 to 12 and checking all other cases incorrect data entering by login user.
I created trigger WHEN-MOUSE-CLICK for button with this body:
declare
     dlug_username number;
     dlug_passwd number;
begin
     dlug_username := length(:user_data_log.username);
     dlug_passwd := length(:user_data_log.passwd);
     if (:user_data_log.username = NULL and :user_data_log.passwd = NULL) then
          :user_data_log.komunikaty_logowania := 'you didn enter any data!';
     elsif dlug_username >= 8 and dlug_passwd >= 8 then
     :user_data_log.komunikaty_logowania := 'Correct data!';
     elsif dlug_username < 8 or dlug_passwd < 8 then
               :user_data_log.komunikaty_logowania := 'Fields USERNAME i PASSWD must have more then 8 sign. Correct them!';
               :user_data_log.username := '';
               :user_data_log.passwd := '';
     end if;
exception
     when VALUE_ERROR then
     :user_data_log.komunikaty_logowania := dlug_username;
end;
When I run this form by Run Form client/server button, it's not matter what I'll enter in two field 'username', 'passwd', when I press button always is invoke exception section
but no if condition.
Now, I don't know what do with this. What is the best way to resolve problems with validation of form elements?
Thanks in advance for all help, some hints, tutorials. I appologise for so long post, but I
want directly describe my problem. Thanks.

Hi,
Regarding to your post and your problem , obviously the code doesn't go into the
IF condition and validate it becouse the syntax is not appropriate and every time it goes to the IF it jumps into the exception part. Thats why you have to correct your code as fllowing.
if (:user_data_log.username IS NULL) and (:user_data_log.passwd IS NULL) then
etc till the end of the code.
Kindly if this approach meet your requirment of solving , update your problem with a Subject of Solved
Regards
Omar

Similar Messages

  • Text Item Validation in Oracle Forms 6i

    Dear All Seniors
    Please guide that how to do validation on text fileds in oracle FORMS 6i.
    I have form like that
    table name= emp
    columns:
    Code, Name
    Code is auto generationg and Name field manually data typed.
    now if
    code, Name
    1 Asim
    2 Asim // it should not take .
    please help.

    Hi,
    You mean it should not take dupliate names or it should not take "//"
    If you have a set of character that should not be there for this field try using instr function. You can check if the field contains any character you don't want to be included in the name field.
    If instr(:name,'A') > 0 then
    message('xxxxxxx');
    Regards
    Yoonas

  • Validation on text item

    Hi all,
    i have a text item P6_MAXLIABILITY
    I put a validation on that item with regular expression.
    I want that validation to happen, when the focus moves to the next item.
    could any one give me a suggestion?
    bye
    Srikavi

    Hi,
    if the focus changes the javascript is event "onblur();" automatically fired. Then you can call own javascript function and validate the input.
    Example:
    <form name="test" action="">
    Name: <input type="text" name="input1" onblur="checkContent(this.value)">
    </form>
    <script type="text/javascript">
    document.test.input1.focus();
    function checkContent (field) {
    if (field == "") {
    alert("Please input something!");
    document.test.input1.focus();
    return false;
    </script>

  • Insert hyperlink into Text Item

    I'm looking to create a footer text item for all reports that has a link that will launch an email to the BI team.  I was able to find some javascript that I can use to launch Outlook but I can only get it to work with a button item or link item.  I can't seem to figure out how to insert it into a Text Item.
    What I want is:
    "If you have any question please contact BI Team"
    where BI Team is the link.
    Thanks.

    Hi,
    i hope you want this functionality in WAD report. have u tried "HREF" in HTML code of WAD for that link.
    for example: you want to open the link on clicking on "BI Team" so write a code in WAD like this
    "If you have any question please contact  <a href="http://mail.google.com/" target="_blank" >BI team</a>
    Hope this will solve you query
    Thanks,
    Om Ambulker

  • Validation in POST-TEXT item trigger

    Hi
    Does POST-TEXT -ITEM trigger fire in ENTER-QUERY mode?
    If not suggest me solution for following scenario:
    I have supplier field in master block. When Form is in -ENER-QUERY mode, i want to validate the user input in the supplier field before user navigate out of the field using TAB KEY (KEY-NEXT-ITEM) or MOUSE (POST-TEXT-ITEM).
    Thanks
    Cheers
    Ram

    The Forms help says that it doesn't, and nor does when-validate-item.
    It looks like you'll have to use the when-new-item-instance trigger. You can store the value of the current field and whenever the trigger fires, run some code to validate that field. If it passes the validation then store the value of the new field, otherwise put the user back in the original field.
    You'll also need to call the code from the key-exeqry trigger, so that you can validate the field which the user is in when they execute the query.

  • How to prevent SAP to copy a manually typed Item text from PO into Info rec

    Hi SAP gurus
    Could you guide me the configuration  to prevent SAP to copy a manually typed Item text from PO into Info record PO text,
    Thanks
    Katta

    Charlie,
    I'm having trouble with copying text from Info Record to RFD.
    When in Spro I put the fix indicator at <*> or <N>, the the system does what it should.
    But when I put the fix indicator at < > blank, then no text is copied.
    Is this normal behaviour ?
    regards,
    Francois

  • Difference between Two Date Should come into Text Item

    Dear All,
    i want to get difference between two date into text Item :P36_C in On Change java script.
    i have two Date Item :P36_A and :P36_B .i have extract these date value from table then difference comes into Text Field :P36_C.
    Now i want if i change Date into Item :P36_A or Item :P36_B then Defference between two date Should Come into Item :P36_C .
    So i have use Java Script Code to do this
    <script>
      function diffdat(){
        function getVal(item){
       if($x(item).value != "")
         return parseFloat($x(item).value);
       else
         return 0;
        $x('P36_C').value =
    getval((TO_DATE('P36_B', 'DD-MON-YYYY'))-
    getval(TO_DATE('P36_A', 'DD-MON-YYYY')))+1;
    </script>
    i have put this into Item HTML Form Element Attributes 
    onChange="javascript:diffdat();"it's not woring .
    How to work that Code with dates.
    Thanks

    You can always create your own difference function based on your own criteria. You can modify this to suit your needs.
    CREATE OR REPLACE FUNCTION CALC_OFFICE_DAYS(date1 DATE, date2 DATE)
    RETURN NUMBER
    IS
    v_begin_date DATE := date1;
    v_end_date DATE := date2;
    v_office_start_time VARCHAR2(10) := '09:30 AM';
    v_office_end_time VARCHAR2(10) := '06:30 PM';
    v_comp_begin_time DATE;
    v_comp_end_time DATE;
    v_days PLS_INTEGER := 0;
    v_hrs NUMBER := 0;
    v_ttltm NUMBER;
    BEGIN
    select trunc(v_end_date) - trunc(v_begin_date)
    into v_days
    from dual;
    select to_date(to_char(sysdate,'DD-MM-YYYY')||' '||to_char(v_begin_date,'HH24:MI'),'DD-MM-YYYY HH24:MI')
    into v_comp_begin_time
    from dual;
    select to_date(to_char(sysdate,'DD-MM-YYYY')||' '||to_char(v_end_date,'HH24:MI'),'DD-MM-YYYY HH24:MI')
    into v_comp_end_time
    from dual;
    select (v_comp_end_time - v_comp_begin_time)/24 into v_hrs from dual;
    IF v_hrs > 4 then
    v_ttltm := v_days + .5;
    ELSE
    v_ttltm := v_days;
    END IF;
    return v_ttltm;
    END;
    As has been noted, this question is best posted on the PL/SQL forum.

  • Spaces removed when inserting a value into a text item

    Dear members,
    (Forms 6i c/s)
    I have a databased function returning a string of characters (varchar2). This value can have spaces at its end.
    When I put this value into a text item in Forms, the spaces at the end are removed.
    How can I avoid that ?
    Thanks for your help.

    Hi,
    There is no elegant solution for this. Metalink has a discussion of the topic in note nr 247715.1
    /Michael

  • Problems Typing into Text Items

    I HAVE PROBLEMS WHEN I'M TYPING STRINGS INTO TEXT ITEMS, IT IS WHEN TYPING SPACE BAR BETWEEN THE WORDS THE CURSOR MOVES FROM THE BEGINNIG OF THE TEXT. I SET THE PROPERTY KEEP CURSOR TO "YES" AND THE CURSOR MOVES FROM THE LAST OF THE TEXT, IGNORING THE SPACE BAR.
    IT ALSO HAPPENS WHEN I'M WORKING WITH DATETIME ITEMS.
    ANYONE CAN TELL ME HOW TO SOLVE IT ?.
    THANKS.
    null

    If u r using Oracle Developer 6 then you need to apply the patches . The latest patch is Patch6a.
    These patches will fix the bugs u have reported plus many more in Forms 6.
    Thanks.
    Thiru

  • Read a barcode(including line feeds) into text item

    When I scan a bar code from a text item, I am unable to retrieve line feeds that are in a barcode. I need line feeds to retrieve various values encoded in the barcode. When I scan the same code on a notepad, I get output in multi-lines. But, oracle forms is removing the line feeds when I scan barcode in a text item. Please advice. Forms Version is 10g

    It gave me output of 10.
    Original string looks like this with control charactes <LF> and <CR>.
    @<LF><CR>ansi 636049030002dl00410466zn05070057dldcabcde<LF>dcbbcdefjklmw
    I have to get hold of <LF> character because it is used as delimiter for data values in barcode. But, when I scan it in oracle forms item, it is not reading <LF> character. Based on what you suggested, using dump and ascii, it ilooks like it is reading carriage return <CR> as CHR(10) and not <LF>. There is one more <LF> in the string and forms text item is not recognizing it. Dump output is shown below:
    @,^J,A,N,S,I, ,6,3,6,0,4,9,0,3,0,0,0,2,D,L,0,0,4,1,0,4,6,6,Z,N,0,5,0,7,0,0,5,7,D,L,D,C,A,B,C,D,E,D,C,B,B,C,D,E,F,J,K,L,M,W,
    Thanks

  • Validating list item with text item havin LOV, how  2 do?

    Dear Sir’s,
    I have two items,
    a) emp_id which is a TEXT ITEM having a LOV
    b) dept_name which is a LIST ITEM.
    Suppose, those employee id’s having 100 and 101, when selected from the LOV, the dept_name list item should automatically become IT_DEPT and the user should not be able to change the value in the list item and the cursor should not be navigable. Like wise, when employee id is 102, the dept_name should show, some of the specific name from the list and not navigable.
    For this, what should I do? Please help me.
    Mitto.

    First in the LOV query select the department name. In the LOV properties, in column mapping properties make the field width as 0 so that it will not be visible in the LOV. In the return item field browse for the item and select it.
    In the run time, upon clicking the lov, the value will be populated automatically.
    I hope this helps.
    Regards,
    Anantha Narayanan
    http://askanantha.googlepages.com

  • How to enter the data into data block text item which has an LOV associated

    Hi,
    I have a data block, one of the data block text item has an LOV assigned. when I populate this text item using the LOV and do "execute_query", it is taking the value in the text item and adding it to the search criteria, but when I enter a value manually in that text item and do "execute_query" it is showing me an alert(which I created) "Please enter a value".
    My question is, why is not taking the value that I enter manually? Looks like before executing the query, this field is getting empty
    How to avoid this problem and make sure that the value entered in the text item is added in the where clause of the query?
    Any advice?
    Thanks in advance
    R.G

    Problem solved!
    Before doing execute-query, all the text items are being cleared,so I used a global variable to store that value
    Thanks anyway
    R.G

  • How to change the "name of column" property of an text item in runtime?

    How to change the "name of column" property of an text item in runtime?
    I look the properties of items in help and found nothing about this!
    It's possible?

    Hi,
    an other solution is change the block property QUERY_DATA_SOURCE_TYPE from "Table" to "Sub-query" , than change at run time the property QUERY_DATA_SOURCE_NAME.
    First create block and add items
    The QUERY_DATA_SOURCE_NAME will be for ex. "Select 'A' as col1, 'B' AS col2, 'C' as col3 from dual"
    Set into items the column name property to col1 , col2 ...
    At run time change the query to "Select 'Z' as col1, 'X' as col2 , 'Y' as col3 from dual"
    in this way you can change the source of column value.
    Caution because if you change value type from varchar2 to date you must cast date into varchar2.
    May be that this way is valid only for view data not for insert-update, i don't remember.
    bye
    Message was edited by:
    Killernero

  • How can i back to Text Item ???

    i have TextItem
    . in Post_Item Trigger i am Checking the value in Text Item
    With Value in DataBase and Get Other Data Related by this value into another Text Item.
    if value not Found in dataBase how can i came back to Text_item to change the value .
    like text item contain code and return Name into another TextItem
    if code not found do not leave TextItem.

    First of all, do NOT do validation like that in a post-text-item trigger. You are needlessly running validation every time the user tabs through the field.
    You should be putting validation ONLY in a when-validate-item or when-validate-record trigger. They only run if the value has been changed.
    And any time you issue an error message, it must always be followed by RAISE FORM_TRIGGER_FAILURE;

  • Multiple values from database on a single text item

    i am trying to do the following
    on a single text item in a form
    (under form property pallete->records->number of items displayed is 5) run a triger "when-new-block-instance" with the following pl/sql statement
    declare
    menu_item VARCHAR2(35);
    begin
    select label into menu_item
    from menu_options;
    end;
    however, once i run the form it gives me
    WHEN-NEW-BLOCK-INSTANCE trigger raised unhandeled exception ORA-01422
    however, if in the pl/sql statement contains only
    begin
    execute querry;
    end;
    then it works fine
    The problem i beleive is the fact that the first querry retreives multiple values or recordset instead of A record.
    How can i go arond this and allow the form to list all the values in this form. Eventually i will need to add conditional SQL statments and that is why just execute querry will not work.
    Also, is there a way to dynamically assign a number to "number of records shown" property?
    All help is very much appreciated!
    null

    Hi, Marko
    I teach Forms, and I usually find a bad idea to use SQL statements directly (in particular when you can "make" Forms to do what you want).
    Inside PL/SQL, a SELECT..INTO statement is supposed to select a single row, otherwise an error occurs.
    EXECUTE_QUERY works.
    If by "conditional SQL statements" you mean restricted (filtered) queries, you don't need to write SQL to do this.
    You can set the DEFAULT_WHERE block property to a different value before using EXECUTE_QUERY, like:
    SET_BLOCK_PROPERTY('your_block', DEFAULT_WHERE, 'where menu_id > 100');
    And the answer to your second question is no, you cannot dynamically change the number of records a block is displaying.
    You can limit the number of records your block queries from the database table using Maximum Records Fetched block property (available in Forms 6 and above, not sure about Forms 5). However, this will only work as expected if you set Query All Records to Yes.
    Hope this helps,
    Pedro

Maybe you are looking for

  • PC Suite - there is no available connection type

    OK, I'm running XP SP2 on an IBM t30 laptop. Looking to have all 3 connection methods available. Bluetooth is Widcomm 3.0.x and PC Suite version is 6.8.22. Initially installed PC Suite fine, but had problems with getting bluetooth connection (IRComm

  • Duplicate IR-L document.

    Hi We are in SAP 4.7. Once the Invoive verification document is posted for all the items for a PO with MIGO system is allowing to post one more document for the same PO. We have checked check duplicate invoice in teh vendor master which should preven

  • Tables for Opportunity "Status" and "Reason"

    Hi, Can someone help me in finding the tables for determining "Status" and "Reason" for an opportunity along with the relvant text descriptions? Regards, Sandeep

  • How to use TC as backup in fiber network?

    I've just got a new fiber network installed at home and I'll use the wireless functionality. And to that I would like to connect my TC. I do not want the TC as a base station only for backup and as a hub for my printer. How do I do?

  • Is it possible to use the status of a checkbox to change the fillcolor of a numeric field?

    I have read through most all of the threads, but found none pertaining to my specific question.  I would like to change the fillcolor of a numeric field based upon the status (on/off) of a checkbox located on a different page.  In other words, if the