Reducing Select list options with keyboard actions - JavaScript help

ApExperts,
My users want a select list with similar functionality to one in MS Access. They want to put the focus on it, then start typing and have their keystrokes 'search' the options. For example, if the select list contains the following entries:
11111
12345
22222
33333
44444
55555
and they type 1 then 2 then 3, they want the element 12345 to be selected, however, an HTML select list widget selects 11111 then 22222 and finally 33333.
I'm hoping JavaScript might be able to do this but I don't know how to code it. I've searched this forum and other web sites but have found nothing useful.
So, is it at all possible and, if so, can you give me an idea of what triggering event to code for and what code to use?
Thanks,
X

BTW, that thread continued - with more options - here:
AJAX, Javascript or just good coding? LOV that filters as you type??
If the select list is fixed, you don't need to pull results back from the server as the user types. Then you could try something like this:
http://www.oreillynet.com/pub/a/javascript/2003/09/03/dannygoodman.html
Doug
Message was edited by:
dccase

Similar Messages

  • Select one option with keyboard

    Hi everyone!
    I have a little question...
    For example when i close one application appears a window with diferents options such as "don´t save", "save", "cancel".. how can i choose one of this options with the keyboard? I only can select with mouse....

    Hi trobalo,
    First of all, Welcome to the Apple Discussion Forums!
    There is a Mac Help topic which you can access by selecting Help Menu when in Finder that you can search for by using the search terms "shortcuts for dialogues" which I beleive is what you are referring to.
    good luck,
    littleshoulders [:-)

  • Help with select list item and dynamics action

    G'Day Apex Gurus,
    I having problems trying to achieve to trigger the help window of a select item automatically. A help window is triggered when the select item label is clicked but my client would like to be triguered automatically as soon as the user click to see the options in the select list.
    I think that I should be able to do it with dynamic actions but I can not get it to work.
    I know when someone click on the label of the select list item trigger this JavaScript
    javascript:popupFieldHelp('277938589795252851','1545903379570909')
    So I want to trigger the javascript also when the user click of the select list item and pull down the options and for that I think that Dynamic actions is the way to go but I can't get it right.
    This is what I a doing:
    I created a Dynamic option as follow:
    Name : test
    Sequence: 30
    Even: Click
    Selection type: Item(s)
    Item(s): P1_RATING <- a selection list item
    Condtion: - No Condition -
    True Actions
    Sequence: 10
    Action : Execute JavaScript Code
    Fire when event result is :True
    Fire on page load: ticked
    Code: javascript:popupFieldHelp('277938589795252851','1545903379570909')
    I appreciate any one who can tell me what i am doing wrong here or provide a solution to my problem of achieving to trigger the help window of a select item automatically.
    Kind regards
    Carlos

    Hi Carlos,
    I set up a test case in exactly the same way and it worked fine for me. I created a page item called P1_DA_DEMO and added some static select list values then added some help text. The settings I used are below, I suggest you try again but also make sure you have no other Javascript errors on the page. Use a tool like firebug to check.
    Name : Dynamic Action Demo
    Sequence: 10
    Even: Click
    Selection type: Item(s)
    Item(s): P1_DA_DEMO <- a selection list item
    Condtion: - No Condition -
    True Actions
    Sequence: 10
    Action : Execute JavaScript Code
    Fire when event result is :True
    Fire on page load: Not Ticked
    Code: javascript:popupFieldHelp('277938589795252851','1545903379570909')
    Event Scope set a s Bind.
    Thanks
    Paul

  • Creating dependent select list menus with javascript

    Hi Everybody,
    I m creating parent and child select list menu. Value of Child menu would be dependent on the value selected in the parent menu. I have tried to implement a code from adobe labs  (http://kb2.adobe.com/cps/149/tn_14924.html) but many strange javascript errors are coming up.
    My code is given below:
    <?php require_once('../Connections/connection.php'); ?>
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
      if (PHP_VERSION < 6) {
        $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;   
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      return $theValue;
    mysql_select_db($database_connection, $connection);
    $query_sector = "SELECT * FROM sector WHERE media_code = 100 ORDER BY sector_desc ASC";
    $sector = mysql_query($query_sector, $connection) or die(mysql_error());
    $row_sector = mysql_fetch_assoc($sector);
    $totalRows_sector = mysql_num_rows($sector);
    mysql_select_db($database_connection, $connection);
    $query_rsList2 = "SELECT subsector_code, subsector_desc, sector_code FROM sub_sector ORDER BY sector_code ASC";
    $rsList2 = mysql_query($query_rsList2, $connection) or die(mysql_error());
    $row_rsList2 = mysql_fetch_assoc($rsList2);
    $totalRows_rsList2 = mysql_num_rows($rsList2);
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    <!-- Dynamic Dependent List box Code for *** JavaScript *** Server Model //-->
    <script >
    <!--
    var arrDynaList = new Array();
    var arrDL1 = new Array();
    arrDL1[1] = "selList1";              
    // Name of parent list box
    arrDL1[2] = "form1";                 
    // Name of form containing parent list box
    arrDL1[3] = "selList2";              
    // Name of child list box
    arrDL1[4] = "form2";                 
    // Name of form containing child list box
    arrDL1[5] = arrDynaList;
    <%
    var txtDynaListRelation, txtDynaListLabel, txtDynaListValue, oDynaListRS; txtDynaListRelation = "sector_code";
    // Name of recordset field relating to parent
    txtDynaListLabel = "subsector_desc";
    // Name of recordset field for child Item Label
    txtDynaListValue = "subsector_code";
    // Name of recordset field for child Value
    oDynaListRS = rsList2;
    // Name of child list box recordset
    var varDynaList = -1;
    var varMaxWidth = "1";
    var varCheckGroup = oDynaListRS.Fields.Item(txtDynaListRelation).Value; 
    var varCheckLength = 0;
    var varMaxLength = 0;
    while (!oDynaListRS.EOF){
    if (varCheckGroup != oDynaListRS.Fields.Item(txtDynaListRelation).Value) {
        varMaxLength = Math.max(varCheckLength, varMaxLength) varCheckLength = 0; }
        %>
        arrDynaList[<%=(varDynaList+1)%>] = "<%=(oDynaListRS.Fields.Item(txtDynaListRelation).Value)%>";
        arrDynaList[<%=(varDynaList+2)%>] = "<%=(oDynaListRS.Fields.Item(txtDynaListLabel).Value)%>";
        arrDynaList[<%=(varDynaList+3)%>] = "<%=(oDynaListRS.Fields.Item(txtDynaListValue).Value)%>";
        <%
        if (oDynaListRS.Fields.Item(txtDynaListLabel).Value.length > varMaxWidth.length) { 
        varMaxWidth = oDynaListRS.Fields.Item(txtDynaListLabel).Value; }
        varCheckLength = varCheckLength + 1; varDynaList = varDynaList + 3;
        oDynaListRS.MoveNext(); }
        varMaxLength = Math.max(varCheckLength, varMaxLength);
        %>
    //--></script>
    <!-- End of object/array definitions, beginning of generic functions -->
    <script >
    <!--
    function setDynaList(arrDL){
    var oList1 = document.forms[arrDL[2]].elements[arrDL[1]];
    var oList2 = document.forms[arrDL[4]].elements[arrDL[3]];
    var arrList = arrDL[5];
    clearDynaList(oList2);
    if (oList1.selectedIndex == -1){
    oList1.selectedIndex = 0; }
    populateDynaList(oList2, oList1[oList1.selectedIndex].value, arrList);
    return true; }
    function clearDynaList(oList){
    for (var i = oList.options.length; i >= 0; i--){
    oList.options[i] = null; }
    oList.selectedIndex = -1; }
    function populateDynaList(oList, nIndex, aArray){
    for (var i = 0; i < aArray.length; i= i + 3){
    if (aArray[i] == nIndex){
    oList.options[oList.options.length] = new Option(aArray[i + 1], aArray[i + 2]);
    if (oList.options.length == 0){
    oList.options[oList.options.length] = new Option("[none available]",0); }
    oList.selectedIndex = 0; }
    function MM_callJS(jsStr) { //v2.0
      return eval(jsStr)
    //-->
    </script>
    </head>
    <body onload="MM_callJS('setDynaList(arrDL1)')">
    <form action="#" method="get" name="form1">
    <select name="selList1" onchange="MM_callJS('setDynaList(arrDL1)')">
      <?php
    do { 
    ?>
      <option value="<?php echo $row_sector['sector_code']?>"><?php echo $row_sector['sector_desc']?></option>
      <?php
    } while ($row_sector = mysql_fetch_assoc($sector));
      $rows = mysql_num_rows($sector);
      if($rows > 0) {
          mysql_data_seek($sector, 0);
          $row_sector = mysql_fetch_assoc($sector);
    ?>
    </select>
    </form>
    <form action="#" method="get" name="form2">
    <select name="selList2"></select>
    </form>
    </body>
    </html>
    <?php
    mysql_free_result($sector);
    mysql_free_result($rsList2);
    ?>
    The javascripts errors that I m getting are :
    Syntax error  test.php, line 20 character 1
      'arrDL1' is undefined  test.php, line 74 character 3
      'arrDL1' is undefined  eval code, line 1 character 1
    Note: I have bolded the lines where error is coming up.
    If more info is needed please tell.
    Please Help,
    Thanks in Advance

    You'd probably have to put a copy of the app on apex.oracle.com for a complete diagnosis, but you could maybe just check that the Source Used attribute for teh select list is set to 'Only when current value in session state is null' and not the 'Always' option.
    Regards,
    John.

  • Can a Link be attached to a select list option?

    Here is some code for a select list that pulls its data from a database:
    <select name = "sid" height = "1"class="dropit" >
    <?PHP while ($row = $result ->fetch_assoc())  {   ;
        echo '<option value='. ($row['id']);
        if (!(strcmp($row['id'], $row['id']))) {echo "selected=\"selected\" ";}
         ?>><?php echo $row['type']?>
    <?PHP } ?>   
    </select>
    This works fine with a form. It is fast, and you can jump to an option just by typing its first letter.
    I would like to code it so that the options have a link to another page attached to them without the need for a form.
    It would show the selected item, and next to it would be a link attached to the word "Update"
    The link would be similar to this: <a href="update.php?id=<?php echo $row['id']; ?>">Update</a>
    It is quite easy to do in a table, with the <a ref in one td and the name field in another like so:
    <table>
    <?php while($row = $result->fetch_assoc()) { ?>
      <tr>
        <td><?php echo $row['id']; ?></td>
        <td><?php echo $row['type']; ?></td>
        <td><a href="update.php?id=<?php echo $row['id']; ?>">EDIT</a></td>
       </tr>
      <?php } ?>
    </table>
    but it does not allow key navigation, and as I have a growing list of over 6000 items,it is becoming painfully slow to use.
    Is it possible to include a URL within the option,
    Or allow the option to be selected with the URL alongside it within the select list?
    Its part of a management system that I am updating.
    For searches on the live web I am able to filter the results in a better way, using a word search system..
    All help appreciated.
    Howard Walker

    Thanks Bregent. I never studied Jump Menus before today.
    A jump menu works to a degree, but unless I have made a coding error, it is not possible to jump to an item in the list by hitting a letter key while the list is active.
    Here is my code using a database table with an id and a single field:
    <script type="text/javascript">
    function MM_jumpMenuGo(objId,targ,restore){ //v9.0
      var selObj = null;  with (document) {
      if (getElementById) selObj = getElementById(objId);
      if (selObj) eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
      if (restore) selObj.selectedIndex=0; }
    </script>
    <form name="form" id="form">
      <select name="jumpMenu" id="jumpMenu">
                 <?PHP while ($row = $result ->fetch_assoc())  { ;?>
                  <option value=<?PHP echo"update2.php?id=".$row['id'] ?> ><?PHP echo $row["id"]." - ";?><?PHP echo $row["field_value"];?></option>
               <?PHP }   ?>
      </select>
      <input type="button" name="go_button" id= "go_button" value="Go" onClick="MM_jumpMenuGo('jumpMenu','parent',1)">
       </form>
    Unless every option has a different link, I can see little use for it.
    Seems little different to a standard form with a drop down menu and a GO button, and that does not need any javascript!
    It does give a workable example of how to populate a jump menu from a database, which I was unable to find on the web.
    Comments welcome.
    Howard

  • Dynamic select list crashes with php

    HI All,
    I can't seem to get a dynamic select list to work in
    dreamweaver. It completly crashes everytime I try adding it to my
    page. I found someone else in the forum who had the same problem
    but no one ever responded. I've tried several things including
    putting just the record set and dynamic select on it's own page
    with no other code on it. It still crashes DW. I also tried coding
    it myself by making a listmenu and modifying it so that the option
    value equals a PHP echo of a value. It crashed there too. Does
    anyone have a piece of code with a working dynamic select list that
    uses a record set that I could look at? That way I can see where
    I'm going wrong. All I'm trying to do is get a simple drop down
    select list of employee names so someone can choose their name to
    get commission. It's a one table, 2 fields (first & last name)
    record set.
    Using DW CS3, php & MySQL.,windows XP Pro
    Any help would be really appreciated!

    AthroughZ wrote:
    > I can't seem to get a dynamic select list to work in
    dreamweaver. It
    > completly crashes everytime I try adding it to my page.
    It looks as though you have a corrupt cache file. Follow
    troubleshooting
    step 4 in the following technote:
    http://www.adobe.com/go/tn_19105
    David Powers, Adobe Community Expert
    Author, "The Essential Guide to Dreamweaver CS4",
    "PHP Solutions" & "PHP Object-Oriented Solutions"
    http://foundationphp.com/

  • Increase value of Select List Item with a Button

    Hi all,
    I've got an apex appli which is working well.
    In one report page I use a select list with a LOV, but I want to "enhance" this functionality:
    I need a kind of button which increments the item-value of the select list by 1,
    so that the user can easily skip to the next value of the LOV without scrolling thru the select list.
    Unfortunately I dont't get it working. Has anyone an idea how to realize that?
    thanks in advance
    Frank

    Hello Frank,
    Assuming your select list item is called P1_SELECT, you can define an HTML button, next to the item, that will do the trick.
    In the Post Element Text field of P1_SELECT, you can have similar code to the following:
      <input type="button" value="Next Value" onclick="$x('P1_SELECT').selectedIndex+=1;" />Hope this helps,
    Arie.

  • Large Select List fails with ORA-6502

    Creating a large select list with htmldb_item.select_list_from_query_xl causes an ORA-6502 when the resulting select list contents are larger than an arbitrary value.
    For example, if the query for the select list returns a display value of up to 50 characters and a numeric id return value of up to 10 digits, we have to arbitrarily include "where rownum < x" (where x is some arbitrary value) in the query to get results; otherwise when the page is run we get the ORA-6502.
    For regular select lists with long results we can get around the problem using htmldb_item.popup_list_from_query but to generate multiselect lists we have to use the htmldb_item.select_list_from_query_xl an include the attribute "multiple".

    Can we get that added to the API documentation? The spec simply states the function returns a CLOB, implying that it would support the max size of a CLOB supported by the database (4GB in 9iR2 as I recall).
    Granted, one should not expect a 4GB web page to be returned using the function call, but a page larger than 32KB isn't entirely unreasonable, especially since this product is geared towards intranet and departmental apps (ie corporate LAN environment).
    An alternative enhancement would be to implement multiselects via the popup list mechanism, allowing users to select multiple items as they "page" or search thru the values for that field.

  • Select list populated with ldap group membership attributes

    Is it possible to query an LDAP group and retrieve all the members of the group?
    For example, if I have an LDAP group with members' login name, I want to retrieve all login names and populate a select list so the end-user can choose a login name from the group.
    Thanks, alan.

    The problem is the second query. I would guess that the TO_CHAR(co) is not unique for each account, but is the same for the accounts. And as the second item in the select-list is the listitems values, all your listitem-entries have the same value. therefore, of you select any entry, the list will always go the the first entry again.
    Adjust your query.

  • A select list combined with auto-complete?

    Hello All,
    I am trying to convert an access application into APEX. There is a field on the form where I can look up various car models (Campry, Corola, RAV4, Sienna, etc) via drop down menu (select list in APEX) or by directly typing “Ca” in the field and it gets auto-completed to “Camry”.
    Is it possible to implement this feature in APEX? If yes, how?
    Thank you,
    Daniel

    Hi Daniel,
    Yes this is possible.
    Have a look here: Ajax Autocomplete (Denes Kubicek)
    There are some examples circulating, in the above thread you find Denes' example.
    Regards,
    Dimitri
    -- http://dgielis.blogspot.com/
    -- http://www.apex-evangelists.com/
    -- http://www.apexblogs.info/

  • Cascading select list in a tabular form -plz help me out

    hello,
    how can i implement cascading select list for filtering my tabular form report results.
    Like i want to have the cascading select list's above the tabualr form report such that when i select the value in one select list, this should populate the values in other select list box(like one select list is dependent on other select list) and try to click a button say refresh, my tabular form report should be refreshed and should filter the report based on the select list value.
    i want to have three select list items above my report - and these select list are dependent on one other - tats why i want to make them cascading select list.
    can anyone provide me with an example of the cascading select list.
    can anyone help me out with cascading select list.
    thanks.

    Aplication item is always hidden - Shared Components > Application Items. You can create only one item and that would also be enough. For transparency purposes I said to create two. However, one will do the job.
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    -------------------------------------------------------------------

  • Select List item with closest upcoming date

    Hello!
    I am creating a workflow for SharePoint 2010 using SharePoint Designer 2010. I do not have Visual Studio, and then ONLY tool I have is SharePoint Designer 2010.
    I have a workflow and need to create a custom variable that is the title field of a Project list item.
    The list items needs to be chosen by three criteria -
    1) It needs to be an item where the project field = ProjectX
    2) It needs to have a status that is not "Complete"
    3)  Iit needs to be the one where the Start Date is the closest to [Today]
    That is, find which task in Project X is the next one to being.
     Once again, this must be done in SharePoint Designer 2010, or with calculated columns.
    Thanks!
    Tom

    I'm thinking that we can set the default view of this list such that it filters for Start Date >= Today and then sort by Start Date. When the Workflow runs through the list, if it uses the default view, then the first returned item will be what it uses.
    I can't test that right now, but I think it's worth a try.
    Andy Wessendorf SharePoint Developer II | Rackspace [email protected]

  • Selecting multiple cells with keyboard command?

    Is there a way in Numbers to select many adjecent cells in a column without using the mouse? I have a document that has thousands of rows, so selecting 2000 cells in a column with the mouse for example, obviously takes forever. I would love to be able to give the command 'select A1 to A2000'

    Hi Jerry,
    I didn't want to select the full column, only part of it, like 2000 cells somewhere in the middle of 4000. But your tip made me play around with the Command and Shift keys and I figured out a way to do it. I selcted the full column, then I Command-clicked on the first cell I wanted to in my selection. That made a 'gap' in the selction. Now I went to the very top of the document and Shift-clicked on the first cell. Then all the cells above my first target cell was de-selected. Then I did the same thing and Command-clikced on the the last cell I wanted to highlight, and then went to the last cell of the document and used Shift-Click do deselect everything below the last cell I wanted to select.

  • Create list options with check boxes?

    Is it possible to create a field that is a list of [names] that could have check-boxes next to them so that users can check the box next to each [name] if that [name] appears in the asset/production?
    I can create a lookup which makes a long vertical list of [names] but it's not a very efficient way of identifying that metadata...
    Cheers

    No.
    A drop-down menu with a checkbox next to each name? Or a multi-line text field that also contains checkboxes? I don't think I've seen either of those approaches supported in any user interface, let alone by Final Cut Server.
    In any case, the answer is no. A checkbox is a boolean value. A lookup is a menu of predetermined choices. A text field is a string. You can't nest the different variable types inside each other.

  • Images with hyperlink in javascript - help needed

    Hai,
    I am having two hyperlinks say, "Good Morning" and "Good Evening". When I am clicking "Good Morning", a small arrow or a picture should display with the hyperlink.
    When I am clicking "Good Evening" this one should have the small arrow or a picture and "Good Morning" will be displayed normally (without picture).
    How can I do this using javascript?
    Did anyone has the code? Pls help me.
    <html>
    <head>
    <title>
    Moves the Arrow When Clicked the Headings for Sorting purpose
    </title>
    <SCRIPT language="JavaScript">
    function remove_picture() {
    function set_picture() {
    </SCRIPT>
    </head>
    <body bgcolor="peachpuff" width="90%" align="center">
    <table>
    <tr>
    <td align="left">Good Morning</td>
    <td>Good Evening</td>
    </tr>
    </table>
    </body>
    </html>
    - yogee

    <html>
      <head>
        <style type="text/css">
          #notclicking .highliter {
            display: none;
          #clicking .highliter {
            display: inline;
        </style>
        <script type="text/javascript">
          function showHighliter(elem) {
            elem.id="clicking";
          function hideHighliter(elem) {
            elem.id="notclicking";
        </script>
      </head>
      <body>
        <a href="#" id="notclicking"
           onfocus="showHighliter(this);"
           onblur="hideHighliter(this)">
          <img border="0" class="highliter"
               src="http://forum.java.sun.com/im/duke.gif"/>
          Good Morning
        </a><br/>
        <a href="#" id="notclicking"
           onfocus="showHighliter(this);"
           onblur="hideHighliter(this)">
          <img border="0" class="highliter"
               src="http://forum.java.sun.com/im/duke.gif"/>
          Good Evening
        </a><br/>
      </body>
    </html>

Maybe you are looking for

  • Controlling Join Path in OBIEE

    I have a dimension table that is the central "hub" of our physical data model. That dimension is joined to 4 different fact tables. I have a query/graph from a previous project release (all was working fine) that only references 2 of those fact table

  • Shake on iMacG5

    Will shake 4.1 run on an iMac G5 with the older non intel processor? iMac G5   Mac OS X (10.4.2)  

  • Plsql webservice

    Hi! I am using JDev 10.1.2 to create plsql webservices based on a package. From this package, I want to expose some procedures that have NUMBER input parameters that may have the value NULL. When testing the generated webservice, I get a java.lang.Nu

  • SXH + MPLS + EBGP

    Hi! My company has Cisco 6506 with SUP720-3BXL. I'm trying to kill two birds with one stone 2 BGP Full View + MPLS VPN in one box. I have a problem with more than 250k labels in LFIB. Seems it creates a new label for each prefix recived from BGP. How

  • Saba and Captivate 6.0

    I am making a project I need to divide into six sections. I want each section to start one after the other. Can I put all of them into one giant zip folder? What formant can I use to tell it do open the next section. Can I use "/." to say it is in th