Selecting the XML data from a drop-down menu or links

Hi, I have this page:
http://www.georgeglazer.com/prints/nathist/botanical/volckinv/volckinv.html
There are prints of lemons/limes and prints of oranges. I
want to have the visitor select which kind of fruit from either a
drop-menu or from two links that look something like this:
Lemons/Limes | Oranges. Looking at other help docs I found the
region/state mapping demo at
http://labs.adobe.com/technologies/spry/samples/data_region/StateMappingSample.html,
and copied the code and tried to modify it. But I don't really
understand the technical shorthand of the help docs (an ongoing
problem I have with the Spry documentation) and I couldn't find the
XML docs that the region/state mapping demos are based on so I
couldn't see how they were set up.
I got as far as this: nothing loads initially when you open
the page (I'd like the lemons to load), but if you select Oranges
from the drop-down menu you see the oranges, and THEN once you've
done that, you can select Lemons/Limes in the drop-down menu and
see those. I have three XML files I've been playing around with to
get this to work: lemons.xml, oranges.xml and inventory.xml, which
combines the two.
I also suspect region/state mapping might not even be exactly
what I'm trying to do here, but I can't figure out from the
documentation exactly what this thing I'm trying to do is called. I
know the photo album demo accomplishes something similar, and I
could do that, but it seems way more complicated than what I need
here (right?). Help will be appreciated!
Thanks,
Helen

I made a different test using the file
http://www.georgeglazer.com/prints/nathist/botanical/volckinv/inventory.xml
and
http://www.georgeglazer.com/prints/nathist/botanical/volckinv/volcktest.html
where I sent up the inventory xml form like one I found in the
Nested XML Data documentation where you have item ids and types, so
all the oranges and lemons are in one XML document (which I'd
prefer).
Here's an abbreviated version of the inventory.xml:
<inv_items>
<inv_item id="1" type="lemon">
<name>Lemons and Limes</name>
<title>Cedro Ordinario</title>
<plate>116a</plate>
<fullimage>pl116a.jpg</fullimage>
<tn>pl116a-2.jpg</tn>
</inv_item>
[and more lemons follow]
<inv_item id="19" type="orange">
<name>Oranges and Others</name>
<title>La Zucchetta Imperiale</title>
<plate>138a</plate>
<fullimage>pl138a.jpg</fullimage>
<tn>pl138a-2.jpg</tn>
</inv_item>
[and more oranges follow]
</inv_items>
What I'd like to do is display the names "Lemons and Limes"
and "Oranges and Others" and when you click on "Lemons and Limes"
you see only the thumbnails for lemons and limes, and when you
click on "Oranges and Others" you see the thumbnails for only
those. I'd like the Lemons and Limes to be selected when the page
is opened.
Help greatly appreciated!

Similar Messages

  • Selecting data from a drop down menu

    Hey all
    I am trying to create a golf leaderboard. It reads from a text file, then generates the playing pairs. These pairs are then output in a drop down menu. I want now to be able to fill in scores for the pair that is selected, and for it to be added to the scoreboard. Is there a way of doing this??
    If you need anymore info or code, just let me know.
    Thanks to everyone in advance.
    WhippingBoy

    i'm doing this in swing. Currently, i am displaying the leaderboard in a textarea. Theni have got a CombBox to display te pairs. Thid is the box i want to retrieve the info from. I have two text areas to enter the scores in, one for each palyer in the pair. I want to be able to recognise which players score is being modified by getting the info from the combo box
    thanks for looking at my problem.
    whippingboy

  • Is it possible to copy data from a drop down menu instead of having to re-type all the data again?

    I am trying to create a form for safety inspections. I need have a list of employees in a drop down menu format. Is there a way to copy the populated drop down menu to be used several times in the document?

    Hi SwitchInc,
    Yes, you can. Please refer to the Screen Shot, hope this help.

  • How to populate data from dynamic drop down list to the text field

    Hi,
    I tried to populate data from dynamic drop down list to city field. I would like to concat data from drop down list.When selecting add button to add the item and select item from drop down list, data should be displayed in the text field. However, Please help. I spent alot of time to make it works I am not successful.
    Please see the link below.
    https://acrobat.com/#d=SCPS0eVi6yz13ENV0cnUdw
    Thanks for your help
    Cindy

    Hi Rosalin,
    Loop the hidden table, get the values and populate drop down in each iteration.
    DropDownList1.addItem("Text","Value");
    You can use one more solution for this scenario. If it is a matter of 2,3 dropdowns, put three dropDowns in the form layout and give seperate static data binding to them. At run time make the dropDowns hide/visible as per the requirement.
    Hope this helps.
    Thanks & Regards,
    Sanoosh

  • HT1918 Trying to make make account changes to my itunes account.  Receive error message regarding province "enter at most 3 letters" when the only option I have is to select from a drop down menu.  Cannot make changes to my account.  How do I get this fix

    As you can tell, this is my first post
    I am attempting to make changes to my itunes account, but when I hit done, an error message "enter at most 3 letters or numbers for province" appears.  I have not attempted to make any modificaitons to this field.  The only options I have for data in this field are picked from a drop down menu.  I have no idea why this msg is appearing.  Any ideas on why it is showing up?  Thanks.

    There seems to be at least one package that can't be located. See the message below from you log file
    Requesting locations synchronously for content SDC00003.2
    with priority Medium    ContentAccess    4/3/2015 1:30:51 PM    2644 (0x0A54)
    The number of discovered DPs(including Branch DP and Multicast) is 0    ContentAccess    4/3/2015 1:30:51 PM    2644 (0x0A54)
    My Blog: http://www.petervanderwoude.nl/
    Follow me on twitter: pvanderwoude

  • Can you eliminate an item from a drop down menu after it is selected once so it isn't selected again

    Can you eliminate an item from a drop down menu after it is selected once so it can't be selected again be someone else?

    I am sorry but Formscentral doesn't support any type of dynamic form content updating.
    Andrew

  • Loading data in a drop down menu using jsp

    hello everyone...
    I'm very new to JSP programming....i'm facing a problem regarding loading the data in a drop down menu at the button click.....
    what i'm doing is...i'v taken a button and at the button click the data from "Sql Server 2000" shd load in a drop down menu....here's the code which i think will make my point clear....
    <%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" errorPage="" %>
    <!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=iso-8859-1" />
    <title>Untitled Document</title>
    <%
              Connection con=null;
              ResultSet rs=null;
              try
                   Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                   con=DriverManager.getConnection("jdbc:odbc:p_portal");
                   Statement stat=con.createStatement();
                   String sql="select * from message_box where name='anindo'";
                   rs=stat.executeQuery(sql);
                   %>
    <script language="javascript">
    function check()
         var show=document.getElementById("mydivtag");
         show.innerHTML = "<label><select name=select><% while(rs.next()){%><option><%= rs.getString(1) %></option><option><%= rs.getString(2) %></option><option><%= rs.getString(3).substring(0,10) %></option></select></label><%}}catch(Exception ex){out.print("Exception is:- "+ex);}%>";
    </script>
    </head>
    <body>
    <form id="form1" name="form1" method="post" action="">
      <label></label>
      <p>       
        <input type="submit" name="Submit" value="Submit" onclick="check()" />
           </p>
      <p>       
       </p>
      <div id="mydivtag" ></div>
      <p> </p>
    </form>
    </body>
    </html>

    yep Ajax is d right way 2 do so.
    So can use DWR(ajax tech.) for dis/
    To implement dis dere r simple steps u hav 2 follow
    1. entry for <dwr> tag in web.xml
    2. entry for <onverter>in web.xml
    3. In jsp u write
    <script type="text/javascript" src="<%=appName%>/dwr/engine.js"></script>
    <script type="text/javascript" src="<%=appName%>/dwr/util.js"></script>
    <script type="text/javascript"src="<%=appName%>/dwr/interface/ClassService.js"></script>
    were ClassService is ur class whose method u want 2 call.
    4.
    In jsp under <script> u can simply write
    ClassService.Methodname(param1,param2,....,CallBackFunction);
    5.CallBackFunction(data)
    /// do wt u want
    For more details u can find it on google.

  • Linking a page as a browser window from a drop-down menu item

    I have tried to link from a drop-down menu item to link to a small browser window instead of a full page.  I tried using the "behaviors" but I got both the regular page and the browser window.  Is there a way to make it just the browser window.
    Thanks.

    I tried that target=_Blank" but I still got the regular page plus the small browser window .  I got rid of the Behavior for now.  My aim is to would display the page in a simple 450 wide x 450 long browser window with a scroll bar with nothing else.  If you can give me a code hint to do that, It would be appreciated.  I'll figure out the rest.
    My HTML coding skills are limited, as I'm used to using FP.(FP seems to be to the Web circles as the Bard's Scottish Play is to the theatrical world)

  • Anyone know why my Oil Paint function would disappear from my drop down menu?

    Anyone know why my Oil Paint function would disappear from my drop down menu?
    Photoshop General Discussion

    southlakebride wrote:
    Not quite sure what you mean. What is CC 2014?
    The next major version of Adobe Cloud software apps.
    CC was released last year. CC 2014 was released last week.
    Cloud-based creative software and services | Adobe Creative Cloud
    2014 release of Photoshop CC: FAQ
    In the Cloud, there is now:
    Photoshop CS6 (has Oil Paint)
    Photoshop CC (has Oil Paint)
    Photoshop CC 2014 (Oil Paint Removed)

  • Form2mail how do I set up the form to sent to a recipient selected from a drop-down menu?

    I am trying to configure dreamweaver form2mail to be able to send the information submitted to individual employees.  I would like the form to be set up where as you choose the recipient form a drop down menu and the only that recipient would receive the information collected on the form.  I can't seem to find any information on this.  I can only find info on sending to multiple recipients at the same time.  I only want the recipient that is selected to receive the form information.
    Alternatively, can anyone recommend a low cost or FREE form to mail system.
    Thanks in advance for your assistance!

    Jim, That is exactly what I need.  I'm using Form2Mail the Dreamweaver extension for Adobe Dreamweaver.  It only gives me the option to send to one email address or cc to multiple not individual sends.
    Here is the html
    <form action="/HDWForm2Mail/Form2Mail.php" method="post" enctype="multipart/form-data" name="form1" id="form1" accept-charset="iso-8859-1">
            <p>
              <label for="message"></label>
              <textarea name="message2" id="message" cols="50" rows="5"></textarea>
            </p>
            <table width="429">
              <tr>
                <td><strong>Recipient:</strong></td>
                <td><label for="recipient"></label>
                  <select name="recipient" id="recipient">
                    <option value="[email protected]">Mr. Person 1</option>
                    <option value="[email protected]">Mr. Person 2</option>
                    <option value="[email protected]">Mr. Person 3</option>
                  </select></td>
              </tr>
              <tr>
                <td><strong>Your Email Address:</strong></td>
                <td><label for="email"></label>
                  <input type="text" name="email" id="email" /></td>
              </tr>
              <tr>
                <td><strong>Attachment:</strong></td>
                <td><label for="file"></label>
                  <input type="file" name="file" id="file" /></td>
              </tr>
              <tr>
                <td colspan="2"><strong>To Submit your email, click the SEND button:
                  <input name="send" type="submit" id="send" onclick="MM_validateForm('email','','RisEmail','message','','R');return document.MM_returnValue" value="Send" />
                </strong></td>
              </tr>
            </table>
            <input type="hidden" name="hdwemail" id="hdwemail" value="lisa+email.com" />
            <input type="hidden" name="hdwok" id="hdwok" value="http://ricochec.com/thank-you.html" />
            <input type="hidden" name="hdwnook" id="hdwnook" value="http://ricoche.com/error.html" />
          </form>

  • How do I get my application to continue processing instead of waiting for a menu selection when the user clicks on a drop-down menu?

    I'm developing a process-control application,using serial communication for data acquisition. My problem - I need this serial read of data to be continuous. But, when I click on a drop-down menu, the rest of the processing halts until I click on one of the menu items in the drop-down list and I lose data in that interval. What can I do?

    In most process-control applications it is not about just avoiding lost measurement data. The most important is having a robust control-algoritm that reacts to a change of input-situation in a given time.
    A non-responsive system is not a very reliable process-control solution.
    The vi you mentioned are only around since the latest versions and the old method of polling controls still suits many applications (but that's another discussion).
    As about RS-232 input time-outs, I have never used that.
    In the time before VISA was created I (as other LabVIEW users I discovered) used a method of storing every incoming string in a buffer (memory-vi with USR) and that still works (classic serial VI's versus VISA is also another never-ending discussio
    n).

  • My mail subfolders are missing from the viewing pane, but available from inbox drop down menu. How do I get them back in the viewpane?

    After a restart, all of my mail subfolders are gone from the side view pane. I can pull them down individually from the 'inbox' drop down menu. How do I get them back into the sidebar so I can sort mail out of the inbox?

    No anti virus software running as far as I am aware, as in I didn't launch any before reinstating the search email function.
    I was running a folder repair function on my inbox (which seemed to complete successfully for the emails in the inbox) when I noticed the majority of the mail folders had disappeared.

  • Show/hide fields when selecting an option from a drop-down menu.

    Hello Gurus!
    I have a question about creating a Java Script withing Acrobat pro.  This is what i would like to do: I created a drop-down menu with several selection entries.  Upon the customer making one of the selection entries, i would like for the correct fields that i created to become visible and all other fields to hide.  Is this even possible to do?  The reasoning behind this is because we have a form that customers have to generate in order to request access to certain financial accounts; we have over 20 different types of accounts and for each instance the customer has to fill out the same form.  By creating a drop down menu, i can use the same form by just changing the drop-down selection and clicking on the designated fields for that selection.  At this time i have over 20 different forms that poing to 20 different account requests and i would hate to send the form 20 different times to one person.  The reason i can not add all fields desired for all accounts is due to the fact that the form would be filled with hundreds of checkmarks and instructions thus making the process too tideous for the customer.  Hope you guys can help out.
    ~Vader

    The good news is, it can be done (and it has been done).
    There are a few things to be aware of, however.
    The most important is that the form must be planned well, which means that you must think carefully about your logic and even more so about your field naming (hierarchical field names are your friend). One fundamental issue, you have to be aware of, is that this form no longer will be a "standard form". The consequence of this is that you may have to be aware that you might get into trouble when you have to prove that your user filled out that particular standard form (talk to your compliance and forms management people about that).
    You also may have to decide whether the form should be usable in Reader. And, if so, how much you want to spend on the right to do so. You will see below why…
    There are actually two approaches for dynamically showing/hiding parts of a form. If your form can be separated between a fixed first page (where you also have the account type selection), and a variable part (depending on the selection), you could use Templates, which you spawn according to the selection, and delete pages when you change the selection. This approach is very easy to implement, but requires Reader Extensions Server to allow it to work in Reader; Acrobat Pro's extended rights are not sufficient for that.
    The other approach is showing/hiding fields. If you did your homework well, it would be very easy to first hide all subsequent fields, and then show the ones you need in two lines of code. This approach does not require extended rights for Reader at all, as long as your forms will always have the same number of pages, for each of your account types. This approach also works for the cases where the differences between the individual forms are very small. It does also work for showing/hiding bigger chunks of the form. In that case, you might create the "background" separately, and then put it as an icon into a button field which you will show/hide together with the carefully placed on top of it active fill-out fields.
    There is a third possibility, which Adobe Propaganda probably would suggest, and that woudl be subforms in LiveCycle Designer. The consequence is, however, that you won't have PDF forms, but proprietary XFA forms instead. And you may have more developing and maintenance work than with the other approaches.
    Back to your original question: you could use a Keystroke script evaluating event.changeEx of the combo box field. Depending on that, you would run your action to set up the according form part. The other way to do it would be evaluating event.value in the onBlur event. The latter would have the advantage that the selection has been made, and you get a bit more time to set up the form (this may in fact be an issue, particularly with Acrobat 9 and 10, which may take their time to show/hide fields).
    Another possibility instead of a drop down (combo box field) would be a popup, where you would have a button to press, and the list of selections pops up. This second method uses app.popUpMenuEx().
    Hope this can help.
    Max Wyss.

  • Filter query based on a value from a drop down menu

    I am using ADFBC/JDev 10.1.3/ADF-faces (JSPX)
    I would like to display a table of data based on a view object and have a drop down menu of values that the user can select from which would filter the table of data. The filter would be applied to a field in the VO. For example, have a JSPX page that shows all employees and have a drop down menu that filters the employees by a specific department with an option to show all departments too in the drop down. I'm not sure if Steve Muench's example #76 (http://radio.weblogs.com/0118231/stories/2004/09/23/notYetDocumentedAdfSampleApplications.html) would serve as a basis for this requirement or not.
    Can anybody give me high level guidance on how to do this? Both declaratively and programmatically would be great.
    Thanks,
    Quoc

    I can't get the JSPX page to display the correct data. It's displaying the entire VO and when you try to select Yes or No or All from the drop down menu, it just changes the Active Flag column in the table to whatever you select for the first row only and still displays the rest of the rows in the VO.
    Here's my JSPX code:
    <?xml version='1.0' encoding='windows-1252'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"
              xmlns:h="http://java.sun.com/jsf/html"
              xmlns:f="http://java.sun.com/jsf/core"
              xmlns:af="http://xmlns.oracle.com/adf/faces"
              xmlns:afh="http://xmlns.oracle.com/adf/faces/html"
              xmlns:cust="http://xmlns.oracle.com/adf/faces/customizable">
      <jsp:output omit-xml-declaration="true" doctype-root-element="HTML"
                  doctype-system="http://www.w3.org/TR/html4/loose.dtd"
                  doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"/>
      <jsp:directive.page contentType="text/html;charset=windows-1252"/>
      <f:view>
        <afh:html>
          <afh:head title="showEmployees">
            <meta http-equiv="Content-Type"
                  content="text/html; charset=windows-1252"/>
          </afh:head>
          <afh:body>
            <af:messages/>
            <h:form>
              <af:panelForm>
                <af:selectOneChoice value="#{bindings['bind_active_flag1'].inputValue}"
                                    label="#{bindings['bind_active_flag1'].label}">
                  <f:selectItems value="#{bindings['bind_active_flag1'].items}"/>
                </af:selectOneChoice>
                <af:commandButton actionListener="#{bindings.ExecuteWithParams.execute}"
                                  text="ExecuteWithParams"
                                  disabled="#{!bindings.ExecuteWithParams.enabled}"/>
              </af:panelForm>
              <af:table value="#{bindings.EmployeesView.collectionModel}" var="row"
                        rows="#{bindings.EmployeesView.rangeSize}"
                        first="#{bindings.EmployeesView.rangeStart}"
                        emptyText="#{bindings.EmployeesView.viewable ? 'No rows yet.' : 'Access Denied.'}">
                <af:column sortProperty="EmployeeId" sortable="true"
                           headerText="#{bindings.EmployeesView.labels.EmployeeId}">
                  <af:outputText value="#{row.EmployeeId}">
                    <f:convertNumber groupingUsed="false"
                                     pattern="#{bindings.EmployeesView.formats.EmployeeId}"/>
                  </af:outputText>
                </af:column>
                <af:column sortProperty="FirstName" sortable="true"
                           headerText="#{bindings.EmployeesView.labels.FirstName}">
                  <af:outputText value="#{row.FirstName}"/>
                </af:column>
                <af:column sortProperty="LastName" sortable="true"
                           headerText="#{bindings.EmployeesView.labels.LastName}">
                  <af:outputText value="#{row.LastName}"/>
                </af:column>
                <af:column sortProperty="ActiveFlag" sortable="true"
                           headerText="#{bindings.EmployeesView.labels.ActiveFlag}">
                  <af:outputText value="#{row.ActiveFlag}"/>
                </af:column>
              </af:table>
            </h:form>
          </afh:body>
        </afh:html>
      </f:view>
    </jsp:root>Here's the bindings page:
    <?xml version="1.0" encoding="UTF-8" ?>
    <pageDefinition xmlns="http://xmlns.oracle.com/adfm/uimodel"
                    version="10.1.3.41.57" id="showEmployeesPageDef"
                    Package="view.pageDefs"
                    MsgBundleClass="view.pageDefs.showEmployeesPageDefMsgBundle">
      <parameters/>
      <executables>
        <iterator id="EmployeesViewIterator" RangeSize="10" Binds="EmployeesView"
                  DataControl="AppModuleDataControl"/>
        <variableIterator id="variables">
          <variableUsage DataControl="AppModuleDataControl"
                         Binds="EmployeesView.variablesMap.bind_active_flag"
                         Name="EmployeesView_bind_active_flag" IsQueriable="false"/>
        </variableIterator>
        <iterator id="DropDownIterator" RangeSize="-1" Binds="DropDown"
                  DataControl="AppModuleDataControl"/>
      </executables>
      <bindings>
        <table id="EmployeesView" IterBinding="EmployeesViewIterator">
          <AttrNames>
            <Item Value="EmployeeId"/>
            <Item Value="FirstName"/>
            <Item Value="LastName"/>
            <Item Value="Email"/>
            <Item Value="PhoneNumber"/>
            <Item Value="HireDate"/>
            <Item Value="JobId"/>
            <Item Value="Salary"/>
            <Item Value="CommissionPct"/>
            <Item Value="ManagerId"/>
            <Item Value="DepartmentId"/>
            <Item Value="ActiveFlag"/>
          </AttrNames>
        </table>
        <action id="ExecuteWithParams" IterBinding="EmployeesViewIterator"
                InstanceName="AppModuleDataControl.EmployeesView"
                DataControl="AppModuleDataControl" RequiresUpdateModel="true"
                Action="95">
          <NamedData NDName="bind_active_flag" NDType="java.lang.String"
                     NDValue="${bindings.EmployeesView_bind_active_flag}"/>
        </action>
        <attributeValues id="bind_active_flag" IterBinding="variables">
          <AttrNames>
            <Item Value="EmployeesView_bind_active_flag"/>
          </AttrNames>
        </attributeValues>
        <list id="bind_active_flag1" IterBinding="EmployeesViewIterator" StaticList="false"
              ListOperMode="0" ListIter="DropDownIterator" NullValueFlag="1"
              NullValueId="bind_active_flag1_null">
          <AttrNames>
            <Item Value="ActiveFlag"/>
          </AttrNames>
          <ListAttrNames>
            <Item Value="Value"/>
          </ListAttrNames>
          <ListDisplayAttrNames>
            <Item Value="Description"/>
          </ListDisplayAttrNames>
        </list>
      </bindings>
    </pageDefinition>Any ideas?

  • Reading from HTML Drop-Down Menu into JSP

    Hi folks. I'm am just delving into JSP, and I have a very basic question. I've been looking around the internet for a good tutorial on how to read HTML form input data into my JSP page. I really haven't found anything, and was hoping that you could provide me with some good resources. I want to have just a basic HTML drop-down menu with a SQL query executed based on the menu selection. The selection from the drop-down menu should go into the SQL query where "Shawnee" currently is. Here is my JSP code:
    <%@ page contentType="text/html;charset=windows-1252" import="java.sql.*"%>
    <%     
    try
         Class.forName("net.sourceforge.jtds.jdbc.Driver");
           Connection con = DriverManager.getConnection("jdbc:jtds:sqlserver://khrcs4:1433/Mail_List;user=xxxx;password=xxxx");
           System.out.println("success");
           Statement st = con.createStatement();
           ResultSet rs = st.executeQuery("select * from contacts where class like '%First Time Home Buyer Lenders%' and served like '%Shawnee%' order by company");
           while(rs.next())
              out.println(rs.getString(3)+"<br>"); //company
              out.println(rs.getString(12)+"<br>"); //address
              //out.println(rs.getString(13)+"<br>"); //address2
              out.println(rs.getString(8)+", "+rs.getString(9)+" "+rs.getString(14)+"<br>"); //city, state zip
              out.println(rs.getString(7)+"<br><br>"); //phone
    catch (Exception ex)
         ex.printStackTrace();
    %>

    ArrayList recList = new ArrayList();
    while(rs.next())
         recList.add(rs.getString(3));
    put the recList in the session.
    session.setAttribute("allrecords",recList);
    Then in your jsp, get the recList from the session and loop it,
    ArrayList recList = (ArrayList)session.getAttribute("allrecords");
    for (var i=0; i < recList.size();++i){
         addOption(document.getElementById("drop-down box name"), valarray, valarray[i]);
    function addOption(selectbox,text,value)
         var optn = document.createElement("OPTION");
         optn.text = trim(text);
         optn.value = trim(value);
         selectbox.options.add(optn);

Maybe you are looking for