This discussion is archived
2 Replies Latest reply: Oct 5, 2012 4:18 AM by Prabodh RSS

how to restrict user to not enter same value in tabular form

JohnMackanzi Newbie
Currently Being Moderated
Greetings !

i m asking second time the questiion because i was not answered preivously, so please dont mind if it is a duplicate one,

question was: i created tabular form as shown in example.

i want to validate username as you see in my example to restrict user to enter the same value in username field before submit page.

e.g when user is entering data as u see test in username in first row, when he/she goes to second row and type the same username like test " message will appear or restrict user that already typed or in use"..

http://apex.oracle.com/pls/apex/f?p=45296:1:22797340776918:::::

this all be done on typing before submit record.

please gudie
  • 2. Re: how to restrict user to not enter same value in tabular form
    Prabodh Guru
    Currently Being Moderated
    Hi,
    i m asking second time the questiion because i was not answered preivously, so please dont mind if it is a duplicate one,
    question was: i created tabular form as shown in example.

    i want to validate username as you see in my example to restrict user to enter the same value in username field before submit page.

    e.g when user is entering data as u see test in username in first row, when he/she goes to second row and type the same username like test " message will appear or restrict user that already typed or in use"..

    http://apex.oracle.com/pls/apex/f?p=45296:1:22797340776918:::::

    this all be done on typing before submit record.>

    Stick the below code in the Page Header > Javascript > Execute when Page Loads field.
    $('[input[name="f03"]').blur(function(){ 
      if ($('input[name="f03"][id!="'+$(this).attr('id')+'"]').val() == $(this).val()) {
         alert('Duplicate Entry.');
         var x = $(this).attr('id');
         setTimeout("(function(p){$('#'+p).focus();})('"+x+"')",100);
      }
    })
    Note :
    a.f03 is the "name" of your username column in the Tabular form.
    b. This validates only the displayed values . If your Tabular Form has multiple pages then all the rows not currently displayed will be ignored.

    Cheers,

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points