Forum Stats

  • 3,783,311 Users
  • 2,254,756 Discussions


Key press update

Dird Member Posts: 1,225
edited Jun 12, 2009 3:38AM in APEX Discussions
Hi, I have a report which displays a list of customer records and then lets you view by city and/or surname. However, for the name typing to take effect you have to hit enter or the search key. Is there a tutorial/easy way to make it so that the search is repeated after every key press on the text field? Here is an example of what I've done so far:

What I'd like is for it to begin showing all records. When the user enters "p" it shows all records whose surnames begin with "p" if you select "london" in the LOV then it restricts it to london customers with surnames "p". If "a" is then entered then it updates the list to those beginning with "pa" from london without the need to click the search button or hit enter. Any ideas?

Thanks for help,


  • Roel Hartman
    Roel Hartman Member Posts: 2,711 Gold Trophy
    Hello Mike,

    See [this article|] on how to do that (in fact it is 'just' an AJAX call on every onkeyup event).

    You can reward this reply by marking it as either Helpful or Correct ;-)
    Roel Hartman
  • Dird
    Dird Member Posts: 1,225
    edited Jun 12, 2009 3:38AM
    Hi Roel, thanks for the reply...

    I've been trying that guide but I can't get it to work. With onLoad="javascript:getUserList('');" -- I found a guide which told me to place it in "Page HTML Body Attribute" and set the "Cursor Focus" to "First item on page". However, it doesn't allow me to make this change as it says:

    Edit: and setting it to "Do not focus on cursor" compiles but does nothing.

    You may not declaratively set cursor focus if you specify an ONLOAD in this attribute. You can programatically set cursor focus by using the following syntax:
    onload="mystuff(); first_field();"

    Any idea what I need to do to get that part of the guide to work? Also in regards to the application process I don't see how it is invoked; it says "This means that the code herein will not be called unless specifically requested" but hasn't said anything about calling it in any way.

    Thanks for help.


    Edited by: Dird on 12-Jun-2009 00:37
This discussion has been closed.