Fill a combo box based on the selection of another combo box

Hi All,
I am new to jsp & java script. I have a arraylist of communities and there are 2 combo boxes meant for source community & destination community.
First user will select Source community , after that I've to remove that community from list and display the option for destination community combo box.
Here the problem is I am getting the source community value in a java script function - "checkSource() " which I've written at the "onClick" of source community.
Now java script variable has that community & list of community is a java variable, so I am not able to remove that community from java list.
Please suggest in the same.
I've written like this -
function checkSource()
     var selIndex = document.targetForm.srcgroupname.selectedIndex;
var srcCommunity = document.targetForm.srcgroupname.options[selIndex].value;
alert("Selected Src Community-"+srcCommunity);
     <%
     alert("Community length-"+community.size());
     community.remove(community.getIndex( %> srcCommunity <%));
     alert(community.size());
     %>
But this is not working. community is a java list.
Please help....
Thanks in Advance
Sneha

Do it with AJAX. Here -> http://www.iem.pw.edu.pl/~opalam/sample/TestAJAX.zip You can download a small, sample project that presents AJAX.
In the project Servlet, Gson and Jquery is used. When onchange is fired in the first select box a js script method is invoked. This method uses ajax to get the json (gson is used to transfer java objects to json) data from the servlet depending on the value of selected option. When data are obtained the second select box is populated. Of course it might be written better but the general idea is clearly visible which was my goal. Hope this helps.

Similar Messages

  • How to populate a dropdown box based on a selection in another Dropdown box.

    I am trying to find out a way to do the following:
    I am using coldfusion ....working on a form. The form has
    couple of dropdown boxes. Based on the selection on the first
    dropdown box another dropdown box needs to get populated with
    different options. These options will be coming from a query. I am
    trying to find out the Javascript code for doing this.
    Thanks in advance.

    jchopra,
    There's a method to doing what you're wanting to do that I've
    used extensively.
    Basically, within my code, I start by invoking the method
    that returns the data for the dropdown lists. Then, I use the
    following code to pour the data returned into a javascript array:
    var locArray = new Array(#evaluate(locs.recordcount+1)#);
    locArray[0] = new Array('','','','','','','','','',);
    <cfloop query="locs">
    locArray[#locs.CurrentRow#] = new
    Array('#JSStringFormat(locationId)#',
    '#JSStringFormat(fkyPolicyId)#',
    '#JSStringFormat(locationNumber)#',
    '#JSStringFormat(description)#',
    '#JSStringFormat(address1)#',
    '#JSStringFormat(address2)#',
    '#JSStringFormat(zipcode)#',
    '#JSStringFormat(city)#',
    '#JSStringFormat(state)#';
    </cfloop>
    Then I wrote a javascript function that is assigned to the
    first dropdown's onChange() event. When the user changes the value
    that is selected within the dropdown, I use javascript to locate
    (using the policyid) the corresponding record in the javascript
    array and populate and/or select the appropriate value(s) in the
    second dropdown.
    If the data returned from the method invocation is too large
    to use within a javascript array, you may need to limit the results
    that are returned.
    Hope this makes sense. If not, please let me know.
    ds

  • Populate 2nd combo box based on value selected in 1st combo box

    I am still using Acrobat 6 though I may be upgrading soon to Acrobat 8. I have a form with two combo boxes, the first "state" has values of MN and WI. Based on which value the user picks I would like to populate a "county" combo box with lists of counties that we deal with.
    Thanks,
    Gene

    One can set the option and export value using an arry:<br /><br />// document level script<br />// Master List of Lists <br />// Each entry in this object listeral is the name of a State <br />//Manually enter the State Names into the state field combo box <br />// The associated value is the item list, where each item is a name value pair, [<County> and [county code, zip code]] <br /><br />// state: ["county name", ["county code", "zip code"]]<br />var oStateNames = {MN: [["-", ["", ""] ], <br />                       ["St. Louis", ["MNStl", "55001"] ], <br />                       ["Carlton", ["MNSCrl", "55002"] ], <br />                       ["Pine", ["MNPin", "55003"] ],<br />                       ["Cook", ["MNCok", "55004"] ] <br />                       ], <br />                   WI: [["-", [" ", " "] ],<br />                        ["Douglas", ["WIDou", "55005"] ] ,<br />                        ["Bayfield", ["WIBay", "55006"] ],<br />                        ["Burnette", ["WIBur", "55007"] ],<br />                        ["Ashland", ["WIAsh", "55008"] ]<br />                       ]<br />                     }; <br /><br />//SetCountyEntries() on keystroke entry in state field <br />function SetCountyEntries() <br />{ <br />   if(event.willCommit) <br />   { <br />      // Get the new counties list from the Master List <br />      // Since the selection is being committed, <br />      // event.value contains the State name <br />      var lst = oStateNames[event.value]; <br />      // Clear the county list if there are no counties for the selected state <br />      this.getField("ee.address.county").clearItems();<br />      this.resetForm(["ee.address.code", "ee.address.zip"]);<br />      if( (lst != null) && (lst.length > 0) )<br />           this.getField("ee.address.county").setItems(lst); // set opiton and export value<br />   } <br />} <br />//  end document level script<br /><br />For the combo box "ee.address.county" one can create an array from the export value to populate the county code and zip code<br /><br />// custom keystroke for county combo box<br />if(event.willCommit & event.value != "") {<br />// split county and zip codes<br />var aCodes = this.getField(event.target.name).value.split(",");<br />this.getField("ee.address.code").value = aCodes[0];<br />this.getField("ee.address.zip").value = aCodes[1];<br />}<br />// end custom key stroke code

  • Dynamic population of second list box based on the selection of first list

    Hai Friends,
    I have the code like this.
    Here my issue is: when the user accesses this page he will get the topic and related categories in the drop down boxes. but when the user changes the topic it needs to populate the categories from the database and kept the topic same for the respective categories. so how can i do this?
    <form name="questionForm" method="post" action="listQuestions.lgs">
    <table bgcolor="F8D8D8" cellspacing="2" cellpadding="2" align="center"
         style="margin-top: 100px">
         <tr>
              <td>Topics:</td>
              <td><select name="topic">
                   <c:forEach items="${model.topics}" var="topic">
                        <option value="<c:out value="${topic.topicId}" />"><c:out
                             value="${topic.topicName}" /></option>
                   </c:forEach>
              </select></td>
              <td>Categories:</td>
              <td><select name="category">
                   <c:forEach items="${model.categories}" var="category">
                        <option value="<c:out value="${category.categoryId}" />"><c:out
                             value="${category.categoryName}" /></option>
                   </c:forEach>
              </select></td>
         <tr>
              <td><a
                   href="addQuestion.lgs?categoryId=2<c:out value="${category.categoryId}"/>">Add
              New Question</a></td>
              <td></td>
              <td></td>
              <td></td>
         </tr>
         <tr>
              <td>Questions under this Category:</td>
              <td><c:if test="${model.questions} == null">
                   <c:out value="no questions found" />
                   <br>
              </c:if> <c:if test="${model.questions} != null">
                   <c:forEach items="${model.questions}" var="question">
                        <table>
                             <tr>
                                  <c:out value="${question.questionDesc}" />
                             </tr>
                        </table>
                   </c:forEach>
              </c:if></td>
         </tr>
         <tr>
              <td colspan="2"><input type="submit" /></td>
         </tr>
    </table>
    </form>
    regards,
    phani.

    Hi Rahul,
    I followed the link what you have mentioned and i need clarification in regarding this....
    function getResponseAction(){
    // Verifying State & Status
    if(verifyReadyState(xmlhttp) == true){
    // Building a DOM parser from Response Object
    var response = xmlhttp.responseXML.documentElement
    // Deleting all the Present Elements in the Drop-Down Box
    drRemove()
    // Checking for the Root Node Tag
    var x = response.getElementsByTagName("option")
    var val;
    var tex;
    var optn;
    for(var i = 0;i < x.length; i++){
    optn = document.createElement("OPTION")
    var er
    // Checking for the tag which holds the value of the Drop-Down combo element
    val = x.getElementsByTagName("val")
    try{
    // Assigning the value to a Drop-Down Set Element
    optn.value = val[0].firstChild.data
    } catch(er){
    // Checking for the tag which holds the Text of the Drop-Down combo element
    tex = x[i].getElementsByTagName("text")
    try{
    // Assigning the Text to a Drop-Down Set Element
    optn.text = tex[0].firstChild.data
    } catch(er){
    // Adding the Set Element to the Drop-Down
    document.questionForm.category.options.add(optn)
    but in my springframe work i have the controller like this where i am putting category object in the context and i am retrieving this in my listQuestions.jsp like this
    <tr>
              <td>Topics:</td>
              <td><select name="topic" onchange="populateCombo(this.value)">
                   <c:forEach items="${model.topics}" var="topic">
                        <option value="<c:out value="${topic.topicId}" />"><c:out
                             value="${topic.topicName}" /></option>
                   </c:forEach>
              </select></td>
              <td>Categories:</td>
              <td><select name="category">
                   <c:forEach items="${model.categories}" var="category">
                        <option value="<c:out value="${category.categoryId}" />"><c:out
                             value="${category.categoryName}" /></option>
                   </c:forEach>
              </select></td>
         <tr>
    package com.lgsglobal.lgsexam.spring.controllers;
    import java.util.HashMap;
    import java.util.List;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import org.springframework.web.servlet.ModelAndView;
    import org.springframework.web.servlet.mvc.Controller;
    import com.lgsglobal.lgsexam.dao.CategoryDAO;
    import com.lgsglobal.lgsexam.dao.QuestionDAO;
    import com.lgsglobal.lgsexam.dao.TopicDAO;
    import com.lgsglobal.lgsexam.hibernate.pojos.Category;
    import com.lgsglobal.lgsexam.hibernate.pojos.Topic;
    public class ListQuestionsController implements Controller {
         private TopicDAO topicDAO = null;
         public void setTopicDAO(TopicDAO topicDAO) {
              this.topicDAO = topicDAO;
         public TopicDAO getTopicDAO() {
              return this.topicDAO;
         private QuestionDAO questionDAO = null;
         public void setQuestionDAO(QuestionDAO questionDAO) {
              this.questionDAO = questionDAO;
         public QuestionDAO getQuestionDAO() {
              return this.questionDAO;
         private CategoryDAO categoryDAO = null;
         public void setCategoryDAO(CategoryDAO categoryDAO) {
              this.categoryDAO = categoryDAO;
         public CategoryDAO getCategoryDAO() {
              return this.categoryDAO;
         public ModelAndView handleRequest(HttpServletRequest request,
                   HttpServletResponse response) throws Exception {
              HashMap mymodel = new HashMap();
              List topics = topicDAO.getTopics();
              mymodel.put("topics", topics);
              if (request.getParameter("topic") != null) {
                   System.out.println("in topics condition to retrieve questions");
                   int topicId = Integer.parseInt(request.getParameter("topic"));
                   Topic topic = topicDAO.getTopic(topicId);
                   List categories = categoryDAO.getCategories(topic);
                   mymodel.put("categories", categories);
                   System.out.println("exiting topics condition to retrieve questions");
              if (request.getParameter("category")!= null) {
                   System.out.println("in category condition to retrieve questions");
                   int categoryId = Integer.parseInt(request.getParameter("category"));
                   Category category = categoryDAO.getCategory(categoryId);
                   List questions = questionDAO.getQuestions(category);
                   mymodel.put("questions", questions);
              return new ModelAndView("listQuestions", "model", mymodel);
    so here my issue is like how i can populate categories in the category(dependent combo). so please let me know the solution.
    awaiting for reply. for any furthere info please let me know....
    regards,
    Phani.K

  • Is there a way to fill a cell with a value based on the selection from another cell?

    For example: If have a drop down menu created for Cell A1 with options (Dog 1, Cat 2, Bird 3). Is there a way to fill cell A2 automatically when I select from the drop down menu.
    So if I selected 'Cat' in A1, cell A2 would automatically input the 2.

    I suggest an extensible method that allows you to add other animals:
    This method adds a small table called "Animal Lookup" that matches names (same as in the pop-up menu) with a value.
    The table on the left uses this table to retrieve the value based on the animal:
    B2=VLOOKUP(A2, Animal Lookup :: A:B, 2, 0)
    select B2 and fill down

  • Create a filtered list based on the selection in another field? URGENT HELP NEEDED

    Hi,
    Hoping someone can help me with something I am working on. i am fairly new to creating forms in acrobat (know how to us the full range of very basic features) but I have now found myself needing some help.
    i am producing an order form, and I need to create a filtered dropdown list based on the value selected in another field.
    basically, when a user select the company chooses their Business Name from a dropdown list, I would like their deliver address to self populate. In some cases there may be a few options for the company delivery address so in these cases the second option would be a dropdown list of the options available for that company.
    i have attached a screenshot, it is the Fields "Business Name" and "delivery Address/Delivery Postcode" that i would like to be linked so that the option in Business Name filtered the options in delivery Address
    Hope someone out there has the time to help me with this, i am using Acrobat Pro DC
    many Thanks
    Lee

    This will require a complex, custom-made script. The basic functionality of populating another field based on a selection in a drop-down is not that complicated, but if you want it to also populate other drop-downs (and then presumably use them to populate other fields), it will require a more complex solutions.
    This tutorial is relevant for your question: https://acrobatusers.com/tutorials/change_another_field

  • Create a drop down list that populates based on the selection form another drop down list.

    I need to set up a drop down list that is popualated (i.e. displays a certain list of selctions in the drop down list) based on the choise the form user selects in an adjacent List
    For example
    There are two drop down list field sitting side by side in the form
    1. Select State          2. Select Course
    What I want to do is have a list of states in the first drop down list (1.Select State) and depending on which state the form user selects , the second drop down list (2.Select Course) will populate with a selction of courses available in that selected state only (i.e. it will on;y show course available in QLD if QLD is selcted).
    Is this hard to do?

    Hi,
    I would recommend some posts from Stefan Cameron's blog:
    http://forms.stefcameron.com/2006/09/18/connecting-a-form-to-a-database/
    http://forms.stefcameron.com/2006/09/29/selecting-specific-database-records/
    http://forms.stefcameron.com/2006/12/18/databases-inserting-updating-and-deleting-records/
    http://forms.stefcameron.com/2006/12/07/better-form-design-with-xfa-25/
    Hope that helps,
    Niall

  • How do I populate one dropdown list based on the selection in another dropdown list?

    I have one dropdown list that has 21 choices.  Depending on the selection of those 21 choices, I have another dropdown list that will select a different subset of choices from a pool of 96 choices.  How do I get this to happen?

    I have one dropdown list that has 21 choices.  Depending on the selection of those 21 choices, I have another dropdown list that will select a different subset of choices from a pool of 96 choices.  How do I get this to happen?

  • I have to combo box content change based on the selection on the other

    I have huge unsolve problem where by I have to combo box change content of the combo box based on the selection in the first combo box . The problem is The value changes do not have effect on the second combo box. Below is the content of the coding used for both the combo box.
    function setReasonCode(obj){
                         <%String sql_query3 = "SELECT DISTINCT (ir_tran_typ) "+
                                              "  FROM intrcd ";
                               System.out.println("trans type"+sql_query3 );           
                                try{
                                    rset = db.execSQL(sql_query3);
                                catch(SQLException e) {
                                    System.err.println("Error in query - intrcd - transaction_main.jsp " +e +" sql " +sql_query3);
                                while(rset.next()){
                                    tran_cde = rset.getString("ir_tran_typ");
                                            tran_typ.addElement(rset.getString("ir_tran_typ"));
                                            System.out.println("trans type 34 "+tran_typ );%>
                                            <% }%>
                                          alert(obj.value);
                                  <%for(int i=0 ;i<tran_typ.size();i++){
                                     System.out.println("trans type 222  "+ tran_typ.size());
                                       tran_cde =tran_typ.elementAt(index).toString();%>
                                       <%System.out.println("trans type before "+ tran_cde);%> 
                                        eval(document.all.tran_cde.option
                                      if(D == <%=tran_cde%> ){
                                       <%System.out.println("trans type D"+ tran_cde);%>     
                                       <%String sql_query2 = "SELECT ir_rea_cde,ir_rea_desc"+
                                              "  FROM intrcd"+
                                              " WHERE ir_tran_typ = 'D' " +
                                                        " ORDER BY ir_rea_cde ";
                               System.out.println("query"+ sql_query2);           
                                try{
                                    rset = db.execSQL(sql_query2);
                                catch(SQLException e) {
                                    System.err.println("Error in query - emmast2 - transaction_main.jsp " +e +" sql " +sql_query2);
                                        index = 1;
                                while(rset.next()){
                                        rea_cde = rset.getString("ir_rea_cde");
                                        rea_desc =  rset.getString("ir_rea_desc");
                                       tran_typ.removeAllElements();
                                       }%>
                                  if( R == obj.value){
                                       alert(R)
                                      if(R== <%=tran_cde%> ){
                                       <%System.out.println("trans type R"+ tran_cde);%>     
                                       <% sql_query2 = "SELECT ir_rea_cde,ir_rea_desc"+
                                              "  FROM intrcd"+
                                              " WHERE ir_tran_typ = 'R' " +
                                                        " ORDER BY ir_rea_cde ";
                               System.out.println("query 2"+ sql_query2 );           
                                try{
                                    rset = db.execSQL(sql_query2);
                                catch(SQLException e) {
                                    System.err.println("Error in query - intrcd - transaction_main.jsp " +e +" sql " +sql_query2);
                                        index = 1;
                                while(rset.next()){
                                        rea_cde = rset.getString("ir_rea_cde");
                                        rea_desc =  rset.getString("ir_rea_desc");
                                       }%>
              <%}%>
                }

    Not unless you know which file in the app sets the choices. I've been through it pretty thoroughly and can't find the one.

  • Dynamically change the contents of one combo box based on the other

    Hi Forum,
    I have a question which might have a possibly simple answer. Well anyway help me out since i could not find the simple answer.
    I am building an application using Swing and binding with BC4J using JClient. My GUI has combo boxes, grids, editboxes. My requirement is that i should be able to dynamically change the contents of one combo box based on the selected item in trhe previous combo box. For example, when i choose a country in the "country combo box", the "states combo box" should show the list of the states of the selected country.
    Now how do i do this using binding. If not, how do i write custom querirs in BC4J layer and return a resultset to the remote application so theat i can populate the dependent combo boxes.
    I will appreciate if anyone can help me out in this regard.
    Thank You
    Sumit

    there could be quite a few number of ways of solving this problem.
    One way is through event handlers.
    taking your example as a model when user selects a country you could fire an action with a flag set to ture. A method will return the states from the DB or your temporary files or what ever and then the true flag will be used in the states combo box rendering.
    other way: javascript
    this might be a bit clumsy as you will need the states information in a property file and you can get the info as the user selects a country.
    regards,
    raj

  • While selecting value from combo box in one frame, based on the selection..

    Hi friends,
    can someone help me out on a issue as it follows:-
    iam developing an application where Iam using xsl,html,javascript and xml.
    There is no existense of Database at all. data is read from xml.
    now,
    In a window there are 3 frames. In the 1st frame combo box is there.
    Based on the selection in the combo box data will be displayed in the 2nd frame.
    now onchange or onselect methods not giving the expected result.
    actually,in the the xsl which is having 3 frames,the 1st and 3rd frame
    calling src="abc.xml" and src="abc.xml"which are static.
    but in the 2nd frame the data need to be changed dynamically.
    I have given frame name="frame_ExchangeDetails2" rows="3%" src="cc_marketWatch_02.xml"/>
    usually data dynamically comes from database.but here i have to refer xml file
    something like [window.href.location="abc.xml"]
    but the problem is when you refer supose:-
    <frame name="frame_ExchangeDetails2" rows="3%" src="cc_marketWatch_02.xml"/>
    the frame is having static page,though there are functions in javascript which are called in onload and onchange.which are not working.
    I have tried putting if condition like:-
    if(document.abc.fieldname.value=='6'
    {   window.location.href = "cc_custLookUpData-mobileno.xml";   
    so that it could go to the repective page.
    but it is not working.
    so what should i do if I select from combo box in one frame and based on the selection xml/html page will be displayed in the 2nd frame.
    if anybody has google account i can forward the zip file so it will be easier to understand.
    Regards
    Message was edited by:
    Postqueries
    Message was edited by:
    Postqueries

    If you have rights to modify tabular model then, you can create a measure in your Tabular model which returns previous week and then use this measure in Pivot Table.
    Thanks,
    Sagar K 
    (Blog: http://datamazik.blogspot.in/)

  • Webtemplates - Disply Group Of Key Figures based on the selection criteria

    Hello,
    I have a requirement of displaying Kefigures based on the selection criteria in the browser.
    Assume that I have Query with the following set of key figures.
    Plan_KF in units CSE
    Actual_KF in units  CSE
    Difference in units CSE
    Plan_KF in units T3
    Actual_KF in units T3
    Difference in units T3
    Plan_KF in units PAK
    Actual_KF in units PAK
    Difference in units PAK
    1) I should have drop down box with values
    CSE
    T3
    PAK
    2) If user selects PAK then query should display only the key figures with units in PAK
    i.e.
    Plan_KF in units PAK
    Actual_KF in units PAK
    Difference in units PAK
    If user selects CSE the query should display only key figures
    Plan_KF in units CSE
    Actual_KF in units  CSE
    Difference in units CSE
    I tried using the DropDown Box - (not much usefull to select more than one Key Figure)
    and CheckBox web items - I have to do multiple selections (Not very much suitable if the Key figures are too many).
    I appreciate your timely help.
    system specifications:
    SAP_BW - 310
    Front-End - 6.20
    Advanced Thanks,
    Ramana

    Hi,
    One alternative would be to save two additional copies of the query (each with different units) and code your dropdown box with the RESET_DATA_PROVIDER command.
    So if your queries were:
    Z_QUERY_CSE
    Z_QUERY_T3
    Z_QUERY_PAK
    You would define the default unit (I'll assume CSE) in yoru web template, and code your dropdown box entries to switch the Data Provider (I'll asume DP1) to the appropriate query.
    The code behind "T3" in your dropdown box would be:
    <SAP_BW_URL DATA_PROVIDER='DP1' CMD='RESET_DATA_PROVIDER' INFOCUBE='Z_CUBE1' QUERY='Z_QUERY_T3'>
    http://help.sap.com/saphelp_nw04/helpdata/en/bd/43143c1ab8ff1ae10000000a11405a/frameset.htm
    Two things to look out for in this work-around:
    1) Number of queries increases by a factor of 3
    2) Performance implication in replacing the data provider with a new query.

  • Multiselect dependant list box based on the database

    i have to develop the jsp page with set of 3 list box which should display a field of a table. Based on the event over the list box1 listbox2 should be updated based on the selected item. For example when u click india on the list box 1 it should display all the states of india in the listbox two. Since it is multiselect when u choose pakistan the list box2 should display the states of india and pakistan.
    This is my prob i am struggling for this for a long while please help me to solve the problem.
    Thanks in advance.
    I want to complete it before today evening i am also new to the jsp please help me...............

    double post http://forum.java.sun.com/thread.jspa?threadID=659520&tstart=0

  • Is there a way to hide some reports based on the selected values in prompt.

    Hi Experts,
    Is there a way to hide some reports based on the selected values in prompt.
    For ex. if a year is selected in the prompt then the report should display year wise report.
    If a year and half year both are selected in the drop down from prompt section then 2 reports should come.. One for year wise and another for half year wise.Kindly look into this.
    Regards
    Ashish

    Hi,
    Use presentation values in prompts for year,half,qtr and month.Example- For year-y is presentation variable in the same way for halfyear-h,qtr-q and month-m.
    create four intermediate reports.Example-Report r1 with only year column,r2 with only halfyear column,r3 with qtr column and r4 with month column.
    Make column in each report(r1,r2,r3,r4) is equal to their presentation variables(y,h,q,m).
    Use four sections.
    Section1-Place report that should come when only year.
    section2-Place report that should come for year and halfyear.
    Section3-Place report that should come for year,halfyear and qtr.
    Section4-Place report that should come for year,halfyear,qtr and month.
    Apply guided navigation for each section selecting guided navigation-
    For section1-
    properties->Guided navigation->check this Reference Source Request(Yes)->select report r1(year)->check this Show Section(if request returns row)
    In the same way do for remaining section2(select r2),section3(select r3) and section4(select r4)
    Thanks,
    Srikanth
    http://bintelligencegroup.wordpress.com/

  • Populating other fields in a form based on the selection in a combobox field

    We have done a form(masterdetail) in which we have a combobox field.When we make a selection in the field we require some two other fields to be automatically populated retrieving data from a table(which has the details required) based on the selection made.For eg. Selecting emp id(combobox) should populate empname and salary automatically in the form.Is this possible?If so how can this be done?
    Thanks & Regards,
    Jayanthi.S

    This is what I did following Michael's suggestion and it works fine :-
    1> Created a dynamic LOV named LOV_EMPNO as:-
    select empno,empno from scott.emp
    2> Started creating a form named FORM024_EMP2 on scott.emp.
    3> On reaching the Formatting and Validation section, I chose the EMPNO field in the left frame.
    In the right frame for EMPNO, I changed the item-type to Combobox and selected the lov LOV_EMPNO.
    Then I went to the Javascript handler section for EMPNO, chose the Javascript event onChange and in the
    adjacent Textarea, I wrote:-
    popdetails(this);
    We will create the javascript function popdetails() in the Additional pl/sql section.
    4> Click next and goto the Additional PL/SQL section and I wrote the following code in
    "...after displaying the page" area.
    (You can write this either in
    before displaying the page,
    before displaying the form,
    after displaying the form,
    after displaying the page).
    declare
    type tvcarr is table of varchar2(2000) index by binary_integer;
    l_empno_arr tvcarr;
    l_ename_arr tvcarr;
    l_sal_arr tvcarr;
    begin
    select empno,ename,sal
    bulk collect into
    l_empno_arr,l_ename_arr,l_sal_arr
    from scott.emp;
    htp.p('
    <script>
    var empdets = new Array();
    empdets[0] = new Array("","");
    for i in 1..l_empno_arr.count
    loop
    htp.p('empdets['||l_empno_arr(i)||'] = new Array("'||l_ename_arr(i)||'","'||l_sal_arr(i)||'");');
    end loop;
    htp.p('
    function popdetails(ele)
    var val = new Number();
    var thisform = ele.form;
    val = parseInt(ele.value);
    if (isNaN(val))
    val = 0;
    for (var i = 0; i < thisform.length; i++){
    if (thisform.name == "FORM024_EMP2.DEFAULT.ENAME.01")
    thisform[i].value = empdets[val][0];
    else if(thisform[i].name == "FORM024_EMP2.DEFAULT.SAL.01")
    thisform[i].value = empdets[val][1];
    htp.p('</script>');
    end;

Maybe you are looking for

  • How can I get my phone to set up a POP3 account instead of IMAP?

    I use a premium Mail.com e-mail account and on my old 3GS, I had it set up as a POP3 account instead of IMAP.  There used to be an option at the top when creating an e-mail account to choose POP or IMAP but this option is no longer present in the 4S.

  • IDOC for Invoice/Billing document

    Hi Experts, Some of our customers want us to send electronic but no paper invoice to them in the coming week. I've investigated the process, steps are: 1. Do some configs for message type of billing document 2. Create KU partner profile and set outbo

  • Log rotation problem

    We are running WLS 8.1.4 and have had a recurring problem with log rotation for quite a long time. It has happened on every machine we've used, running both Windows 2000 and XP. What we want to do is have our logs roll nightly, but it seems that no m

  • Cannot run Apatche and FullFilment services on Windows 2000.

    Hi, We are using Oracle EBS 11i with database 9i. Today morning we had face virus attacked on ERP server. We have windows env and single node installation. After restoration of backup We are unable to start the following serviices on windown env: Thi

  • "Red eye correction" goes beyond the eyeball.

    I'm using PSE 3.0, Windows XP Home. Occasionally, when I try to apply "red eye correction", the "darkening" effect is applied to areas of the cheeks, eye brow, or forehead (as well as the eye). My guess is: The subject's skin color or "cosmetic makeu