Loading multiple dependent select lists

What is the best way to load select lists that are dependent on the previous one?
ex.
Select School
based on school you select the subjects
select subject
based on subject you select the courses,
etc
I'm trying to stay away from as much javascript as possible.
thanks for the help!
Michael

You can use javascript, or resubmit the page and laod the dependant select list based on what was selected.

Similar Messages

  • Multiple value selection lists - Problem filtering

    I'm builing a news application with publisher, and one of the fields is a multiple value selection list. We're filtering news stories to different pages based on the values. Problem is, I can't get the right content items to display. I did it no problem with a single selection box. The code I'm using is:
    <pcs:foreach expr="folderByPath(folder, '../../Articles')" var="articles">
         <pcs:foreach expr="articles" var="art">
              <pcs:if expr="art.testkeyword == 'choice2'">
                   </pcs:value>"><pcs:value expr="art.headline"></pcs:value></a><br />
              </pcs:if>
         </pcs:foreach>
    </pcs:foreach>
    So if 'choice2' is in a single select list, no problem. If it's part of a multiple select, I get nothing. I'm thinking I'm missing something really easy, like logic operators. But I couldn't find anything of help in the documentation

    Hi,
    Make use of contains function.
    Syntax : contains(string1,string2) this returns true if string 1 has string 2
    Usage
    <pcs:if expr="contains(test,'A')">
    </pcs:if>
    ** 'test' is the name of the multi select box
    Edited by bharatkarthik at 06/22/2007 4:10 PM

  • Embarrassing questions.. :/  Dependent Select Lists

    One more embarrassing question to feature my narrow knowledge.
    I want to create dependent select lists. Have tried following the procedure as in help:
    <p>You can have one LOV drive another LOV by: </p>
    <ul>
    <li type="disc">
    <p>Creating a basic form. </p>
    </li>
    <li type="disc">
    <p>Defining two lists of values. Note that the driving LOV must submit the page after a value is chosen. </p>
    </li>
    <li type="disc">
    <p>Defining a branch that branches back to the current page. </p>
    </li>
    </ul>
    <p>Consider the following example. The first LOV enables the user to pick a state. </p>
    <pre xml:space="preserve">SELECT state_name d, state_id v FROM states </pre>
    <p>The second LOV selects the country name and country ID based on the state selected in the first LOV. </p>
    <pre xml:space="preserve">SELECT county_name d, county_id v FROM counties WHERE state_id = :Px_STATE_ID </pre>
    I try to follow the procedure and I get nothing in list two.
    I am trying to make it this way that if a country selected in 1st list then only regions to that country get listed in 2nd select list.
    Can someone "spell" this out for me? With an example? I had previously asked similar question here and never figured out solution out of it, so I am embarrasingly asking once more...
    Hrefna the persistent

    Hi Earl,
    Can you please help me out? Hope so.
    I then created a page with a text field called
    P1_EMPNO.You're not using select list items on the page? That's what this thread is about - although the specifics can be adapted to other page item types.
    I added onblur="get_AJAX_SELECT_XML(this,'P1_ENAME')"
    in the Form Element Attributes.
    My question is, how do I create P1_ENAME? Is it a
    LOV, text, etc.Don't know. What are you trying to accomplish? I thought you wanted one select list item to help you narrow down the number of items in a second select list - but it sounds like you've got something else going on. Please explain exactly what your UI requirements are.
    Earl

  • How to create dependent Select Lists?

    Hi,
    Found in the documentation that to create dependent select list we have to do these 3 things:
    1. In the parent select list, choose the option "select list with submit".
    2. Defining a branch that branches back to the current page.
    3. In the child select list sql, use the value of the parent (eg. :P6_PARENT_SELECT_VALUE).
    When I change the value of parent select list the page is getting submitted and its going to the parent page. I've a branch that goes to the parent page but how to create a branch that comes back to the same page and then use it in parent select list?
    Thanks,
    Hozy

    Hi Hozy,
    1. Make the branch conditional...
    2. Create a new branch while will run when you make a selection in parent select list.
    Also check this site to create dependent select list without sumbitting the page....
    http://www.dba-oracle.com/t_html_db_apex_ajax_application_express.htm
    Regards,
    Shijesh

  • AJAX dependent Select lists

    Can anyone please help me figure out where am going wrong?
    I have 2 regions on page 1. Region 1 is supposed to have 2 drop down lists (cascading i.e values in second drop down Drop List HJ are dependent on value selected in first lov Ajax Select HJ). Region 2 will be a report.
    I am trying to create AJAX cascading lovs based on eg. provided on carl's application so that Region 2 is not refreshed each time I select a value from the drop down's
    [http://apex.oracle.com/pls/apex/f?p=36391:37:1510004986327720::NO:RP::]
    I have downloaded the application and tried to do the exact same steps, but my child lov is not updating its values after I select a value from in Ajax Select HJ.
    My application is available at http://apex.oracle.com/pls/apex/f?p=33829:1:2010637670427735:::::
    Appreciate any help on this
    Thank you
    Deepu

    Thank you Denes !! The example really helped me. Now I am stuck at the next level. I am new to apex and learning and building dashboard for my organization. So, please bear with me.
    I have a page that is divided into 4 regions. Each region displays a chart that is generated dynamically. When I say dynamic, each region has 2 drop down lists.
    First pull down has Org and Year as values, if they wish to view chart by Org or Year. If they choose Org, second drop down defaults to Org. If they choose Year, second drop down displays Year's as 2010, 2009,2008 so on. Depending on which year they choose they should be able to view that Year's chart by month in that region.
    Initially I had used select lists with submit for drop down's but that was refreshing the whole page. But now after using your example with AJAX I was able to accomplish the cascading Lov's stuff. Now, after user selects a value in second drop down, is there a way that I can display the chart and refresh only that region each time user selects a value from the drop down.
    I want to avoid refreshing the page each time, I need each region to refresh based on user selection in drop down's. Is this possible in apex? Is there any example that you could direct me to.
    Thank you so much for all your inputs. Appreciate it very much
    Deepu

  • 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.

  • Dependent Select Lists

    i am not able to do this
    I have two fields
    one item is select list with value as Month/Year
    another item is not edit-able one ,
    but the value should be populated based on the selection in the previos item
    if item1 value is ='Month'
    populate item2 as Yes
    else item1 value is ='Quarter'
    populate item2 as No
    iam very new to this,
    please help me step by step procedure,
    thanks

    Hello,
    There is a couple different ways to do this here is a link to one way
    How to make LOV's reference other LOV's on the form page
    and here is a link to another way
    http://forums.oracle.com/forums/thread.jspa?threadID=260481
    If neither of these work for you just do a search for select list in the forum and you'll get quite a few hits.
    Carl

  • How to do dependent select list based on parent select list

    Hello... I have the following bit of code...
    *parent select
    htmldb_item.select_list_from_query(1,null,'select program_desc_eng, program_id from myfps_programs')
    * child select using parent value
    htmldb_item.select_list_from_query(2,null,'select sub_pgm_desc_eng, sub_program_id from myfps_sub_programs where program_id = <VALUE FROM ABOVE?>')
    I know this is easily done using the select list form items and such but I need to use the htmldb_item function. On screen when a user selects value from the parent select list, I want the child select list to use the value of the parent as a parameter into its own select list. How can I reference the parent? (ie can I use htmldb_application.g_f01(1) or something of this nature?) I realize I may need a bit of javascript to have it work correctly but I'm just wondering if its possible?

    This is not a trivial task.
    See http://forums.oracle.com/forums/thread.jspa?messageID=1241356

  • Select List problem

    I have 3 select lists: the first two are with submit and the last one is just select list. Each list depends on the previous one.
    I have set null and default values for each list. The problem occurs when I first start the application, but after selecting an option in the first list all is fine and when I reset the fields everything works as it should.
    So the problem only occurs when the application is first launched....
    This is the error message:
    Error: ORA-01858: a non-numeric character was found where a numeric was expected performing List of Values query: "SELECT TESTTIME d, TESTTIME r FROM TESTSETUP WHERE TESTDATE = :P3_TESTDATE and TERM = :P3_TERM ".
    How can this be corrected?
    Any help would be greatly appreciated.
    Thank - Greg

    I have set null and default values for each list
    These values are not available in committed session state for the subsequent select lists to use.
    Solution: Create a OnLoad Before Header computation (conditional upon the value of the select list being null) to set it to whatever null/default value you want. This will "initialize" the value so that your dependent select lists can work properly.

  • AJAX Select Lists on Updateable Reports

    All,
    I have followed the examples from Karl and Sergio's blog on how to use AJAX to contol dependent LOV lists in a form. My question is, can this be done in an updateable report? I'm having difficulty in determining how to reference the column names of the dependant lists.
    What I basically have is a time app. User selects his project from a picklist and then his associated tasks for that project will appear in the task list. I have used the updatable report option to build this rather then a form, because I liked the prebuilt add row and processing functionality.
    Anyway if anyone knows how to use AJAX dependant select lists in an updateable report it would be greatly appreciated.
    Thanks
    Rob

    See http://forums.oracle.com/forums/thread.jspa?messageID=1222153&#1222153

  • Crystal Token (Multiple Values Selection)

    Hello Experts,
    I am using a view for a custom report and have a problem with token i have defined. I would like to Token to display multiple value selection list so user can check the style he need.
    Ex: When i use select * from OITW the token displays item code selection list but when i am using view crystal does not display selection list. Does the tokens respect Views? Please advise.

    Hi Praneeth
    Try this
    code@select T1.V1_code, T1.V1_name FROM OADM T0 CROSS JOIN View1 T1
    It seems that putting a B1 table in there makes it work.  The same applies to selection from UDT's
    Hope this helps
    Rob

  • Select List with Submit refreshes page to top force users to scroll down

    Hello All,
    I have Dependent Select List where this functionality driving select list submit values to a subsequent select list.
    The "Select List with Submit" refreshes page where the unintended by-product is page refresh, which returns to top of page and therefore force users to scroll back down.
    In other words: I have a long form page where I have a Dependent Select List. So when you change the value of the 1st select list it refreshes the 2nd. This is all fine, but when the refresh occurs, the Form-focus returns to the top of page. This makes the users scroll back down to the lower end of the Form where they left off. This would make usability problems for users.
    Anyway we can make the Form return where to the area(Item or Region) where the user was during the selection of the Select List?
    Thanks in advance,
    Konstantine

    HURRAY!! I got it to work perfectly using anchors. I am adding this message to help future ApEx developers.
    I have been searching the Forum for 3 days and have read numerous postings. There was a lot of good discussion on anchors and linking from page to page. But, nothing exactly like my situation.
    Situation: Have a page, PG4, with a button, PG4_BUTTON, that redirects to a different page, PG7. PG4_BUTTON has its 'Display In Region' field set to PG4_REGION. When PG4 is run and the form displays, the PG4_BUTTON is located at the bottom. When the user would click PG4_BUTTON, the user would be taken to PG7. (this is good) The user enters some data in PG7 fields and then clicks a create button, PG7_BUTTON. PG7_BUTTON would submit data. An After Processing, Go To Page, Branch would be activated when this button was pressed and then the user would be returned to a refreshed PG4, at the top. This forces the user each time to have to scroll down to the bottom of PG4 to continue. (this is NOT good)
    Solution: On PG4, I edited the region, PG4_REGION. For the region 'Title' I added an anchor before the actual name. So it looked like this:
    {a name="REGION_TO_RETURN_TO"></a}PG4_REGION
    please note: where I have the curly braces above '{' '}' you need to put < the pointed and '>'
    Next, on PG7, I edited the Branch. On the 'Edit Branch' page, in the 'Action' region, I changed the 'Target type' field from 'Page in this Application' to 'URL'.
    To the 'URL Target' text area field I added this:
    f?p=&APP_ID.:4:&SESSION.::::::#REGION_TO_RETURN_TO
    So, there you have it. If you still need to read other postings, here are a couple of the sites I read:
    Re: Lists that go to items
    Re: URL target on a button.  What is the syntax??
    How to use <a name="top">Hello I'm at the top </a> tags in apex url ?
    Re: anchor or go to item from a branch
    http://www.oracle.com/technology/products/database/application_express/howtos/howto_navigate_in_a_page-1.6.html
    http://www.echoecho.com/htmllinks.htm
    http://www.htmlcodetutorial.com/linking/linking.html
    http://www.w3schools.com/HTML/html_links.asp
    Thanks,
    Maggie

  • Checked some items of multiple-selection list box when form loaded in infopath

    Hi
    I customize sharepoint list with infopath. I have multiple-selection list box and want to checked some items of that automatically when form loaded. how can do this?
    Thanks.

    Hi,
    According to your description, my understanding is that you want to pre-select some items in the Multiple-Selection List Box.
    I recommend to follow the steps below to achieve this goal:
    Click Default Values under Data tab in InfoPath, expand the dataFields and navigate to the Multiple-Selection List Box field.
    Set the Default Value of the Multiple-Selection List Box field.
    Right click the field under the Multiple-Selection List Box group, then select Add another Value Below and set the Default Value for this field.
    Repeat step3 based on the number of the items that you want to be pre-selected.
    More information are provided in the link below:
    http://www.bizsupportonline.net/infopath2010/pre-select-items-multiple-selection-list-box-infopath-2010.htm
    Best regards.
    Thanks
    Victoria Xia
    TechNet Community Support

  • How can I have multiple-selection list box "select at least one checkbox" option active only when the section it's in is visible?

    Hi, I'm using SP13 and InfoPath2013.
    I created a custom form and published it to SP13 document library.  This form has many MSLB.  Depending on the checkboxes selected in the 1st MSLB, the other MSLB will either hide or show.  Each MSLB is in its own section.  The requirement
    is to have each MSLB to have at least one checkbox selected.  Well, the problem is that when that MSLB isnot checked in the 1st MSLB it is not visible and shouldn't require any checkbox to be selected.  However, the form can't get submitted instead
    an error dialog would pop up and ask user to make a selection for MSLB that is not even displayed.  Is there any way to fix this besides unchecking all MSLB to be not required at least one selection?  Thank you.

    Eric, 
    I follow your reply post here and still doesn't work.  I also noticed your screen shot of selecting a field is not the same as what I see in InfoPath 2013.  
    Here is what I did, 
    1.Check At least one selection required for
    these Multiple-selection List Boxes
    as you want .
    2.Create a Formatting  rule for the 2nd
    Multiple-selection List Box.
    3.Add a  Condition as below:
    4.  I get a validation error if I don't
    select at least one checkbox in the hidden MSLB control when submitting.
    I think I'm following all the steps correctly
    but please let me know if I'm not.

  • Multiple Select List does not Refresh with Dynamic Action

    All,
    Scenario:
    Using APEX 4.2.2, I have a Select List page item (P4_SPONSOR) set to allow multiple values which has a dynamic LOV to populate the list.  What I would like to do is highlight the display values based on another page item's value (P4_DRIVER_ID).  When I set the source of P4_SPONSOR to static text, such as a delimited string of 1:2:3:4, any display values where the return values are equal to the static text are highlighted when the page loads.
    Problem:
    The problem lies in trying to use a query as a source for P4_SPONSOR which is filtered based on the other page item, P4_DRIVER_ID.  For instance, my SQL Query (returning colon separated values) returns the same as the static text noted above.  In the query's WHERE clause, I specify that the driver's ID is equal to P4_DRIVER_ID:
    SELECT sponsor_id
    FROM sponsors_drivers_xref
    WHERE driver_id = :P4_DRIVER_ID;
    This, as I understand it, would necessitate a refresh of P4_SPONSOR whenever the value of P4_DRIVER_ID changes.  So, I have a Dynamic Action that does just that.  When executed on the page, I can see the P4_SPONSOR multiple select list actually refresh, but none of the display values become highlighted.
    Thoughts?
    Thanks,
    -Seth.

    Seth,
    A dynamic action refresh of your select list will refresh the list of values (this is what you are seeing), it will not refresh the value of the item itself.  In fact, it will remove any values that you had already selected.  To refresh the value you will need to add additional dynamic actions.
    Create another dynamic action with:
    Event: After Refresh
    Selection Type: Item(s)
    Item(s): P4_SPONSOR
    If this was a normal select list you could just create a Set Value action and use your query to set the value of the select list.  Since this is a multiple select list your will need to get your colon delimited value first and then use some javascript to set the values of your select list.
    Create an hidden page item name P4_SPONSOR_TEMP.
    Add a true action to your new dynamic action:
    Action: Set Value
    Set Type: SQL Statement
    SQL Statement:
    SELECT sponsor_id
    FROM sponsors_drivers_xref
    WHERE driver_id = :P4_DRIVER_ID;
    Page Items to Submit: P4_DRIVER_ID
    Selection Type: Item(s)
    Item(s): P4_SPONSOR_TEMP
    Add another true action to your new dynamic action:
    Action: Set Value
    Set Type: JavaScript Expression
    JavaScript Expression:
    $("#P4_SPONSOR_TEMP").val().split(":")
    Selection Type: Item(s)
    Item(s): P4_SPONSOR
    --Jeff

Maybe you are looking for