Selecting combo box value

Hi,
I want a code in jsp or javascript for selecting combo box value and it is assigned to another variable.
Example: If combo box value is Number, it is assigned to 0. If como box value is Name, it is assigned to 1.

hey thanks for the info hunter...but it is related to core java..actually im workin on jsp,html n stuff..so any help on tht would be refreshing..
vinay

Similar Messages

  • How can we pass selected combo box value to a jsp pag?

    Hi All,
    I want to pass selected combo box value to a same jsp page's variable.
    i am using javascript
    <select onchange="this.options[this.selectedIndex].text">
    </select>
    this selected value should be invoked for a jsp page's variable.
    Excepting for favorable reply
    Vansh

    select2.jsp
    <script>
    function x()
         alert(document.f.s.options[document.f.s.selectedIndex].text);
         document.f.submit();
    </script>
    <body>
    <form method="get" name="f" action="select2.jsp">
    <select name="s" onchange="x()">
    <option checked>--select--</option>
    <option value="1"> vijay </option>
    <option value="2"> kumar </option>
    </select>
    </form>
    </body>

  • Combo box in JavaScript and store the combo box values into database

    i am a developer, i have a task ie.. i have combo box in JavaScript and i have to store the combo box values into database through JavaServerPage..
    i please every one to have a look on this and please reply soon....

    dear sir,
    your suggestions are really greater the god.............
    i have applied as you said , now i am the page as updated and also i nform you that its multi select ....
    i will show the codings , then u will get a clear identification
    <script language= "JavaScript">
    <!--
    function one2two() {
        m1len = m1.length ;
        for ( i=0; i<m1len ; i++){
            if (m1.options.selected == true ) {
    m2len = m2.length;
    m2.options[m2len]= new Option(m1.options[i].text);
    for ( i = (m1len -1); i>=0; i--){
    if (m1.options[i].selected == true ) {
    m1.options[i] = null;
    function two2one() {
    m2len = m2.length ;
    for ( i=0; i<m2len ; i++){
    if (m2.options[i].selected == true ) {
    m1len = m1.length;
    m1.options[m1len]= new Option(m2.options[i].text);
    for ( i=(m2len-1); i>=0; i--) {
    if (m2.options[i].selected == true ) {
    m2.options[i] = null;
    //-->
    </script>
    <form method="POST" name="theForm" action="update.jsp">
    <table bgcolor="white" border="1" cellpadding="5" cellspacing="2" align="center">
    <tr><td align="center">
    <select id=menu1 size=10 multiple>
    <option>javascript</option>
    <option>php</option>
    <option>Zeo</option>
    <option>asp</option>
    <option>jsp</option>
    <option>ajax</option>
    <option>struts</option>
    </select>
    <p align="center"><input type="button" onClick="one2two()" value=" >> "></p>
    </td><td align="center">
    Languages you know:<BR>
    <SELECT NAME="language" multiple>
    <OPTION VALUE="c">C
    <OPTION VALUE="c++">C++
    </SELECT>
    <p align="center"><input type="button" onClick="two2one()" value=" << " ></p>
    </td></tr></table>
    <center><input type="submit" value="update"></center>
    </form>
    <h4><u>Back<h4>
    <script language= "JavaScript">
    var m1 = document.theForm.menu1;
    var m2 = document.theForm.language;
    </script>
    </body>
    </html>

  • Multiple-Selection List Box Values in Multiple Columns

    I am using InfoPath 2010 with SharePoint 2013. I have a form with a multiple-selection list box which has A LOT of choices. Instead of displaying all the choices in one column, is it possible to display the values of my list box in several
    columns? 

    Hi Andrea,
    I agree with Brij, one multiple-selection list box is associated with one list field, we cannot use the one multiple selection list box value for other multiple selection list boxes, we need to create multiple choices for each multiple-selection list box
    control in InfoPath form.
    Thanks
    Daniel Yang
    TechNet Community Support

  • How to change screen combo box value from a method?

    Hi,
    I have a screen that has a combo box and an ALV.
    the combo box has the line numbers of the data in the ALV.
    you can select the line item and then the ALV changes...
    I fill the combo with function VRM_SET_VALUE.
    all is good once the user changes the combo box.
    I want to enable the user to click (hotspot) on ALV and then to ... and to change the value of the combo box to the line number he clicked on.
    I couldn't change the value inside that box.
    The combo box is declared as global parameter.
    when I assign a value to it inside the method, it is good. but once back to PAI, it is the old value.
    Do you have any idea how to set up that value?
    Thanks.

    Itay,
    When you load the combo box, you should be setting a "key" for each entry in the combo box.
    See below:
      move '2010FY' to Value-Key.
      move '2010 - Full Year' to Value-Text.
      append value to list.
      move '2010Q1' to Value-Key.
      move '2010 - Q1' to Value-Text.
      append value to list.
      move '2010Q2' to Value-Key.
      move '2010 - Q2' to Value-Text.
      append value to list.
      move '2010Q3' to Value-Key.
      move '2010 - Q3' to Value-Text.
      append value to list.
      move '2010Q4' to Value-Key.
      move '2010 - Q4' to Value-Text.
      append value to list.
      move 'COMBO1' to name.  "name of Combo box in the screen
      call function 'VRM_SET_VALUES'
        exporting
          id = name
          values = list.
    So add these "keys" to a hidden column in the ALV grid.  Then .... when the user presses a hotspot, pass the value of the hidden column (for the selected row) into the COMBO1 box.
      move '2010'FY' into Combo1.  " if they selected Full Year of 2010

  • Combo box values

    hi
    when i choose cfl in first column of matrix the another column(combox box) show only releated values of first column..
    for example when i choose when i choose sales order number in first column the combo box columns show only that sales order items no only...not for all items...please any one help me....
    Dim str, str1 As String
                            Dim oForm As SAPbouiCOM.Form
                            oForm = veeAppApplication.Forms.Item("Plan")
                            veeMatConvMatrix = oForm.Items.Item("PlansMat").Specific
                            'str = veeMatConvMatrix.Columns.Item("Assigned").Cells.Item(pVal.Row).Specific.value
                            str1 = gonMatConvMatrix.Columns.Item("Ecode").Cells.Item(pVal.Row).Specific.value
                            If str1 <> "" Then
                                Dim tmpTotal As String
                                tmpTotal = str1
                                Dim Rs As SAPbobsCOM.Recordset
                                Rs = veeCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
                                Rs.DoQuery("SELECT T0.[U_StName] FROM [dbo].[@PLAN_DETAIL]  T0 inner join [dbo].[@PLAN_HEADER]  T1 on t0.docentry=t1.docentry WHERE T1.[U_Prcode] = '" + str1 + "'")
                                Dim iRemark As String
                                iRemark = (Rs.Fields.Item("U_StName").Value)
                                veeMatConvMatrix.Columns.Item("Col_Ctask").Cells.Item(pVal.Row).Specific.value = iRemark
                                BubbleEvent = False
                                                       End If

    I think you have to manually populate each combobox after the first column selection is over.
    You have to remove values from the combo box and then add only satisfied values to it.
    For a comboboxcolumn all the cells in this column will be showing the same valid values.
    Example.
    First row-> Sales Order number is 1 - populate the column with those items
    When you move to second, you have to remove all items and then add related items to the combo box.
    Any other method?
    Thanks

  • Problem in Combo Box Values

    Hi Members,
    I have an combo box in a user designed screen. I have to list the sales order number for an chosen customer in the combo box.
    My problem is that all the values are not listing for that customer.
    Sample coding is as follows:
    strSQL = "select DocNum from ORDR where CardCode='" & objform.Items.Item("4").Specific.String & "'"
            objRS.DoQuery(strSQL)
            While Not objRS.EoF
                objCombobox.ValidValues.Add(objRS.Fields.Item("DocNum").Value, objRS.Fields.Item("DocNum").Value)
                objRS.MoveNext()
            End While
    Please kindly help me in this regard.
    Thanks,
    Venkatesh.R

    Hi Venkatesh,
    Please insert a breakpoint in this line
    objRS.DoQuery(strSQL)
    Then code the value of the strSQL variable and execute it on the SQL Server Management Studio. I'm guessing it returns no records, so there will be no values in the ComboBox.
    Regards,
    Vítor Vieira

  • Changing Drilldown on Stacked Coulmn Charts with auto-selected combo boxes

    Hello Experts,
    i have a big issue and no idea how to solve it. Hopefully you can help me. I would really appreciate that so thanks for any answer in advance.
    Here my problem:
    I have two stacked column charts and two combo boxes. Each combo box shows filtered row data in one chart. That works fine.
    Now i want to implement drilldown which will change the data of the other chart by clicking. Example: Chart 1 represents the working hours of different staffs, chart 2 represents working hour in different projects. Now, I have a staff A who works in projects A and B. Projects A and B are now the rows in chart 1. By clicking on row project A the second chart should show me the data of project A. In project A there are several members stacked in the chart showing the whole working hours of the project. Now i want to change the perspective by clicking on a row in chart 2 so the data of employee XY is showing up and so on.
    I realized it by drilldowns. however there is no data but the row's name insertion. this cell is my trigger cell for the combo boxes so it will choose the right person/project automatically if i click on a row. In both charts is "No Selection (-1)" activated, in combo boxes is "When Value changes" picked.
    At the beginning i worked fine. my dashboard had displayed the data i wanted by clicking on the rows. but at a specific point my dashboard crashes.
    I figured out that if i drill down once the selection will not disappear. so on two drill downs there is an automatically selection of a specific row and at the end my dashboard crashes and no data is displayed.
    To solve my problem i need something to deselect my selection automatically or a reset for only one graph. i have worked with push buttons but its like the reset button because the row's name disappear too.
    Whether Xcelsius components or excel formulas, i have no idea how to solve my problem.
    Im grateful for every hint.
    Kind regards
    Lars Schmidt

    Well I need to get this thing done by tomorrow. The
    end goal is a program that will take data from text
    boxes, wrap predefined XML tags around them, and
    export them to a XML file. He's also sent me another
    *.java file which creates a XML file, but that also
    doesn't workThat's nice.
    Sun's basic Java tutorial
    Sun's New To Java Center. Includes an overview of what Java is, instructions for setting up Java, an intro to programming (that includes links to the above tutorial or to parts of it), quizzes, a list of resources, and info on certification and courses.
    http://javaalmanac.com . A couple dozen code examples that supplement The Java Developers Almanac.
    jGuru. A general Java resource site. Includes FAQs, forums, courses, more.
    JavaRanch. To quote the tagline on their homepage: "a friendly place for Java greenhorns." FAQs, forums (moderated, I believe), sample code, all kinds of goodies for newbies. From what I've heard, they live up to the "friendly" claim.
    Bruce Eckel's Thinking in Java (Available online.)
    Joshua Bloch's Effective Java
    Bert Bates and Kathy Sierra's Head First Java.
    James Gosling's The Java Programming Language. Gosling is
    the creator of Java. It doesn't get much more authoratative than this.

  • On button click of Infopath forms select multi select list box values...

    Hi,
    We have multi select list box on one of the info path forms. We have placed on button on this form. If user clicks on this button we want to select some of the values in Multi select list box (check box).
    Is it possible if yes how can we achieve it?
    Thanks.
    Regards,
    Amit Chhatbar

    Hi Amit,
    From your description, you would like to check items in a multi-selection box when a button is clicked.
    I’d recommend you make use of rules in InfoPath form, i.e. when button is clicked, then set a field’s value.
    However, if you are using multi-selection box, then you could only set the value of one item at a time. If you want to select several items at once, then we could use code. For more information:
    http://www.bizsupportonline.net/blog/2009/07/understanding-multiple-selection-list-box-infopath/
    http://www.bizsupportonline.net/infopath2007/programmatically-select-all-items-multi-select-list-box.htm
    If you are using several check boxes to replace multi-selection box, then it will be more easy. The rule could be that when this button is clicked, set a field’s value (check box field) to true and repeat it.
    Regards,
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected] .
    Rebecca Tu
    TechNet Community Support

  • How to Save the multiple selection check box values into the database

    i have the multiple selection check box implemented in UI through drop down list,i can choose the desired values from the drop down through checkbox, but i m unable to store these values and commit the values into the database all at a time.

    You can access the values using listbinding and can then store them as a string by using a delimiter.

  • Distinct dataset for selection combo box

    Hi,
    I have a dataset displayed on my page with paging and
    dependant detail region as well as filter functions. Works like a
    charm. For a visual look
    here
    My issue is this: To enable the filter with drop down select
    list (aka combo box) shown in the picture I implemented the
    following code
    var transactlist_xml = new
    Spry.Data.XMLDataSet("transactlist-xml.php",
    "export/row",{sortOnLoad:"account",sortOrderOnLoad:"ascending",useCache:false,loadInterva l:60000});
    var accounts_xml = new
    Spry.Data.XMLDataSet("transactlist-xml.php",
    "export/row/account",{sortOnLoad:"account",sortOrderOnLoad:"ascending",distinctOnLoad:tru e});
    The first dataset selects the data for the entire list, the
    second for the combo box. It works alright, but I deam it to be
    very inefficient. I have to call the php script that does the data
    selection twice, which means double the database load. Not good.
    Since I have selected all the data I need in the first statement,
    is away I can reduce the number of direct source reads and costruct
    the second dataset out of the first?
    I tried
    var accounts_xml = transactlist_xml.distinct();
    with no success, as transactist_xml has all the fields still
    included, so clearly the rows will not be distinct.
    Any suggestions/thougts?
    Any hint is appreciated.
    Hanno Schupp

    "How to Use The Focus Subsystem"
    http://java.sun.com/docs/books/tutorial/uiswing/misc/focus.html

  • How to get the current selected value of a combo box or a option button?

    Hello All,
    I want to catch the current selected value of a combo box and also of a option button and want save it into different variables in my code. These option button and combo box are in a SAP business one form which I have created through VB dot.net coding.
    But I don't know how to do that, can any one send any example code for this.
    Regards,
    Sudeshna.

    Hi Sudesha,
    If you want to get the selected values you can do it as follows: The Combo Box value you can get from the combo box. If you want to get it on the change event, you must make sure that you check when BeforeAction = False. If you want to get an Option Button value you should check the value in the data source attached to the option button.
            Dim oForm As SAPbouiCOM.Form
            Dim oCombo As SAPbouiCOM.ComboBox
            Dim oData As SAPbouiCOM.UserDataSource
            oForm = oApplication.Forms.Item("MyForm")
            oCombo = oForm.Items.Item("myComboUID")
            oApplication.MessageBox(oCombo.Selected.Value)
            oData = oForm.DataSources.UserDataSources.Item("MyDataSourceName")
            oApplication.MessageBox(oData.ValueEx)
    Hope it helps,
    Adele

  • Help needed on combo-box dynamic values??

    Hi ,
    i need to populate values in 2 combo-boxes where the values
    in the second combo is dependent on the first .. from db ...
    i.e if i select a value in 1 combo then the values in the second combo should be populated accordingly from the db..
    pls suggest on this.

    You can use onchange event of the first combo box, then you can submit a form sending the first combo box value, then response filling the second combo box.
    If you don't want to make a request, you should use ajax to get data from database.

  • Combo Box Selected Data

    I have a combo box called class_cb, I am trying to use the
    combo box in a maths formula.
    I am trying to set that if the active selected combo box data
    = 1 then a text area = given number, if data = 2 then ....
    I can get flash to recognise the change i just can't seem to
    get the statement
    "if selected combo box data = 1 then text area = 5" to work,
    the text area defaults to the first value and changing the
    combo box item and pressing calculate doesn't change the
    value of the text box.
    Any help would be appreciated, thanks
    // COMBO BOX
    // Add Items to List.
    class_cb.addItem({data:1, label:"Normal"});
    class_cb.addItem({data:2, label:"Free"});
    class_cb.addItem({data:3, label:"Close & Interference"});
    // Update Upon Change Listener Object
    // Create Listener Object.
    var cbListener:Object = new Object();
    // Assign function to Listener Object.
    cbListener.change = function(event_obj:Object) {
    trace("Value changed to:
    "+event_obj.target.selectedItem.data);
    // Add Listener.
    class_cb.addEventListener("change", cbListener);
    // CALCULATE
    shaft_ta.text = "nul";
    //On calculate_btn release
    //Math functions
    calculate_btn.onRelease = function(){
    //If combo box = data no. then change label
    if (class_cb.selectedItem.data = 1) {
    shaft_ta.text = "6";
    } else {
    if (class_cb.target.selectedItem.data = 2){
    shaft_ta.text = "7";
    } else {
    if (class_cb.selectedItem.data = 3){
    shaft_ta.text = "9";
    }

    can any one help?, I have tried many different things and
    still can't get it to work.

  • How to populate a list box linked to selection in combo box?

    Hi All,
    I am a beginner in Xcelsius. I am having problem on how to populate a list box based on the selection on my combo box.
    I have a combo box and a list box.  The combo box value consist of Countries. Values are:
    Singapore
    Indonesia
    Thailand
    When I select, for i.e. Indonesia, I want to populate the list box with all the Postal Code of Indonesia. When I select Thailand, i want to do the same.
    Can anyone shed some lights on how to achieve this?
    My spreadsheet data is as follow
    Country         Postal Code
    Singapore     680123
    Singapore     680124
    Singapore     680125
    Indonesia     155123
    Indonesia     155124
    Indonesia     155125
    Indonesia     155126
    Thailand       333123
    Many Thanks,
    Harianto

    Hi,
    I am detailing the complete steps below:
    In the combobox select the entire range of Country while seeing the records from the Combobox, Xcelsius will automatically show the unique values in the selection.
    After that in the "Data Insertion" section for Combobox select the "Insertion Type" as "Filtered Rows" (please click on the question mark beside this option and it will show how the selection works).
    In the source select the postal code, in the destination select the range which will be used as a data source for the list box.
    This will resolve the concern. Please remember to select the question mark beside the "Insertion Type" option, it explains the working in specific details.
    Best of luck.
    Regards,
    Gourav

Maybe you are looking for

  • I have a pc, iphone 4s and ipad2, my daughter has an iphone 4s and macbook pro.  I want to share an itunes account.  Can there be two icloud accounts sharing one itunes account?

    Between my daughter and I, we have 6 devices, can they all share the same itunes account and have two separate icloud accounts?  My itunes account ID is different from my apple ID and my daughter's apple ID.  Is it ok that they are all different.  If

  • WHY CAN'T I SIGN IN!?!?

    Okay, I can't take this anymore. I've been trying to log into my skype account on my laptop for over a year and it won't do anything for no reason. Every single time I try it makes it more complicated then it needs to be so I log in with my microsoft

  • Amendment in Purchase Order

    Dear Sir/Madam,          How is it possible to amend in Purchase Order when the Purchase order is already approved for Item as well as service order after finally Punching the PO after approval.\ Regards Niladri Bhusan Harichandan

  • System landscapes in SLD

    Hello, Does any one have experience using other landscape definitions in the SLD? What can be the use in XI. Will it be possible to use systems from different landscapes via this way in the central sld? Thanks, Emile

  • Option to set 'all calls' on by default

    I've been told there's an option in CUCM 9.1.2 to set 'all calls' on by default, as opposed to the user having to activate it themselves.  I'm trying to find where to enable it at, but I'm not seeing it.  Has anyone come across this or am I losing my