How to get value of html combo box (i.e select) in jsp?

Hello,
I was just wondering how to get value of html combo box in jsp page. My code for combo box is:
<select name="combo" size="1">
<%
List<Project> projects = mgr.getProjects();
for(Project project : projects){
%>
<option value="<%= project.getId()%>"><%= project.getName()%></option>
<%
%>
</select>
I thought combo.value might give me the value, but it throws exception.
Any help is appreciated.
Thanks.

The combo does not exists in Java, but only in HTML. You have to submit the form containing the combo and then use request.getParameter("combo") to get it's value ;-)

Similar Messages

  • How to get values in the combo box in a XML form?

    Hi All,
        1. I have created a property which has "Default value" as "Clothings" and  "Allowed Values(csv)" as Real Estate - Sales , Clothings etc" by navigating to KM > CM > Global Services > Property Metadata > Properties.
       2. In the XML form builder when I drag this property I get a combo box for this property.
       3. But when I preview this by going to Content Management > Folder > New > FORMS > and select my XML form project I get a preview but it is not showing me the default values in the combo boxes which I created using the property in XML form builder.
    Please Suggest me as to how to get those values (which I mentioned in property) in the combo box ?
    Thanks in Advance,
    Jasmine.

    Hi All,
      I ll make the above Query Simple.
    1.In Xml Form Builder when you drag a property which has some 3-4 assigned values so you are  recomended to use a combo box.
    2.But the problem after using COMBOBOX is I am not getting these values in the preview of the combo box.
    3.Help Required please its urgent.
    Thanks in advance,
    Jasmine.

  • Search Engine issues and how to get multiple answers in combo box

    I'm doing a project in vb6 i have a data where when i search it should give multiple answers in combo box.
    example i have a debtor code each debtor code as more than one addresses when i search in one debtor code how can i get multiple addresses in the combo box. my search engine command
    as follows 
    Private Sub Command2_Click()
    Adodc1.Recordset.MoveFirst
    Adodc1.Recordset.Find "DEBTOR_CODE = '" & Text11.Text & "'"
    If Adodc1.Recordset.EOF = True Or Adodc1.Recordset.BOF = True Then
    MsgBox "Record Not Found!", vbApplicationModal
    Adodc1.Recordset.MoveFirst
    Me.Combo1.SetFocus
    Me.Combo1.ListIndex = Me.Text11.Text
    End If
    End Sub
    when i search in my text filed i should answer to the debtor code i'm finding and multiple answer in the combo box for the same debtor code.
    Please help ;( 

    Hello,
    This forum is for VB.NET for VB6 please review the links at
    the following page.
    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem.

  • How to compare value of two Combo Box

    I've two Combo Box(cbFirst & cbSecond). I want to compare the value that has been selected by the user and based on the result, output is displayed. In both Combo Box I've provided the value.
    Here is my code:
    var a:Number;
    var b:Number;
    function First(evt:Event):void{
        a = evt.target.value;
        trace(a);   
    cbFirst.addEventListener(Event.CHANGE, First);
    function Second(evt:Event):void{
        b = evt.target.value;
        trace(b);
    cbSecond.addEventListener(Event.CHANGE, Second);
    If (a > b){
         trace("a is greater")
    else
         trace(b is greater);
    The trace statement inside the functions are working fine and the correct value of a & b is printed. But the comparison in the if statement doesn't seem to work. Could you please help me out.

    there's a typo.  fix it or remove it:
    var a:Number;
    var b:Number;
    function First(evt:Event):void{
        a = evt.target.value;
    trace(a);
       compareF();
    cbFirst.addEventListener(Event.CHANGE, First);
    function Second(evt:Event):void{
        b = evt.target.value;
        trace(b);
    compareF()
    cbSecond.addEventListener(Event.CHANGE, Second);
    function compareF(){
    If (a > b){
         trace("a is greater")
    else
         trace(b is greater);

  • Interactive Report: how to get value of given row/col cell in selected row

    Hi -- I have an interactive report. Instead of the default behavior of the link going to a single row view, I want it to
    go to a form for editing the row. This means I have to be able to populate the form w/ the correct row's information...
    so need to get the value(s) for the PK column(s) in the selected row of the interactive report, so I can select the row
    from the database.
    How can I do this? I see in the report attributes, Link Column section, I can set Rows Uniquely Identified by, and a Unique
    Column (though there could be more than one in a PK). I imagine I'd want to use the rowid, but I'm not sure how the
    rowid of the selected IR row can be referenced. And at that point, I'm not sure how to get the IR column value for
    that row. (Say I'm on the 8th row and I need the first column... How is the column referenced? By a number, it's name,
    its heading?)
    Or maybe I'm not on the right track at all...
    Ideas?
    Thanks,
    Carol

    Hi Carol,
    What I´m trying to do is: defining a button such as when you click it a pl-sql procedure is called, which needs as an input parameter the id of the row selected in my form. what I need first, then, is to get the id of the selected row. how did you get it?
    Thanks in advance
    Francesco

  • How to get value stored in  javascript function and display in a JSP

    i am doing a questionaire which is for user to input data in every question, After user input the data, a javascript function will be called to do some score calculation. Since each question will carry its final score after the calculation by the javascript function, so i use an array to store those scores and then display those scores in the same page.
    However, i have to make a confirmation page to display both data and calculated score in another jsp, i only know how to display the data as it is a textfield that i can get the value by "request.getParameter("textfield1"); but i dun know how to get those scores as they are stored in an array in the javascript function, what way i can do??

    thank you for all your help!
    I have chosen to set the score value to the hidden field when every time run the function
    <script language="javascript">
    function cal(index){
    var thisForm = document.MC;
    thisForm.score1.value=score[index];//set value to the hidden field     
    </script>
    <input type="hidden" name="score1" value="">
    <input type="hidden" name="score2" value="">
    <input type="hidden" name="score3" value="">
    The function will calculate only one score when every time being called. So that i can only assign one score to one hidden value at a time.
    e.g, assign score[1] to thisForm.score1.value
    assign score[2] to thisForm.score2.value
    assign score[3] to thisForm.score3.value
    how can i do this??

  • How to get value in Second Drop Down based on selection made in first dropd

    Hi All,
    I have a table with first two columns as dropdown.
    The values in first drop down are fixed. However the value in second dropdown should be populated based on selection made in first .
    e.g
    First Column had different departments say IT, SALES, HR.
    Based on department selected I have to populate employee of that department.
    For first dropdown I have taken Drop down by index.
    What should I select for second drop down and achieve desired functionality? Please guide.
    Regards,
    Madhvika

    Hi
    Use drop down by key for fixed values IT, SALES, HR. create on_select action for that drop down.
    in on_select method code like this..
      DATA lo_nd_segment1 TYPE REF TO if_wd_context_node.
      DATA lo_el_segment1 TYPE REF TO if_wd_context_element.
      DATA ls_segment1 TYPE wd_this->Element_segment1.
      data lt_segment1 type wd_this->elements_segment1.
      DATA lv_segment TYPE wd_this->Element_segment1-segment.
      data lr_column type ref to cl_wd_table_column.
    navigate from <CONTEXT> to <SEGMENT1> via lead selection
      lo_nd_segment1 = wd_context->get_child_node( name = wd_this->wdctx_segment1 ).
    get element via lead selection
      lo_el_segment1 = lo_nd_segment1->get_element( ).
      lo_el_segment1 = WDEVENT->GET_CONTEXT_ELEMENT( 'CONTEXT_ELEMENT' ).
    get all declared attributes
      lo_el_segment1->get_static_attributes(
        IMPORTING
          static_attributes = ls_segment1 ).
    now ls_segment1 contains your first drop down selection value.
      DATA : lv_dropdown type string .
      lv_dropdown =  ls_segment1-segment.
      if lv_dropdown = 'IT'.
    // here fill your second drop down based on IT value.
    endif.
    Hope it solves.
    Cheers,
    Kris.

  • 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

  • Form development - Getting a value from a combo box

    Hey,
    I have recently started form development in IDM. I seem to have stumbled at the first hurdle. I have created a combo box with some hard coded values. I want a variable to hold the value of what is currently selected in the combo box. The reason is what is selected in the combo box will affect what appears further down on the form.
    Can anyone help me achieve this?
    Thanks for your time

    There may be many good answers to this problem. One may be the fact that the value of the combo box is accessible futher down in the form simply by referencing the name of the combo box.
    For example, if the name of the combo is cmbVal and assuming the base context is variables, you can later reference that field (in a Disable, Derivation, Expansion...) with <ref>cmbVal</ref>.
    If the base context was variables.user, the same would hold true, let's say, for waveset.capabilities, where the reference would be <ref>waveset.capabilities</ref>.
    A more creative alternative might include setting a Process, Activity, or Action level variable in the expansion of the combo and then referencing that value later on. This requires that the combo has action and isn't as good of a solution as the first.
    Hope that helps.

  • How to get values from afLiterator ?

    Hi All,
    I have a grid populated records using af:Iterator. Row are populated from the List model(say product list). The iterator component i binded in the bean.
    Now i have showing 5 records per page. total 3 pages are there.
    There is a boolean check box for each rows. and a common check box to select all the rows in the page.
    I dont know how to get the rows of current set when i select the SelectAll checkbox, similarlly i have to do the same when i go to page 2 of the iterator.(page 2 means next range of records in the iterator)
    My requirement is using the af:iterator not af:table.. please help

    Hi,
    af:iterator does i) not keep track of selection states and ii) stamp data
    i) The selection state needs to be tracked with <f:attribute ...> tags added to the check box component. The value of the attribute should identify the row (ideally by a unique key). The name of the attribute is up to you. When you iterate over the selected check boxes you call getAttribute() on the check box component to access your custom attribute for identifying the row instance
    ii) rows are no individual instances and there fore cannot be directly accessed. af:forEach may be a better fit for your use case as it created component instances that then allow you to call the JSF parent container and getChildren on this. You then look for the checkbox component instances and verify its selection state. For selected components you the access the custom attribute
    Frank

  • Value of two combo box is not persistent on change of a third combo box

    Hi All:
    I have flex page in which i have 3 combo boxes. I would be
    selecting first 2 combo box and when i select the third combo box ,
    i would get the value of previous two combo selection and display
    data accordingly.
    My problme here is when i do a change in 3rd combo box the
    values of other combo boxed are defaulted to "Select..." without
    maintaining my previous selection.
    I am stuck in this for a while. I would really appreciate if
    you can help me out in this.
    Thanks
    Kan

    there's a typo.  fix it or remove it:
    var a:Number;
    var b:Number;
    function First(evt:Event):void{
        a = evt.target.value;
    trace(a);
       compareF();
    cbFirst.addEventListener(Event.CHANGE, First);
    function Second(evt:Event):void{
        b = evt.target.value;
        trace(b);
    compareF()
    cbSecond.addEventListener(Event.CHANGE, Second);
    function compareF(){
    If (a > b){
         trace("a is greater")
    else
         trace(b is greater);

  • How to get value from list item

    Hi all,
    How to get value from list item?
    I have a problem with the List Item object
    in the Oracle forms.
    How can I retrieve the selected item from
    a list ?
    I didn't find any function like 'list.GET_
    SELECTED_ITEM()'...
    thanks
    Bala

    Hello,
    You get the value as for any other Forms item:
    :value := :block.list_tem ;Francois

  • How to get values/data stored in the database into a list-item.

    how to get values/data stored in the database into a list-item.
    i tried to make a list item without any values assigned to it...but i got the below error.
    FRM-30191: No list items defined for required poplist.
    or
    FRM-32082: Invalid value for given item type.
    List EMPNO
    Item: EMPNO
    Block: EMP
    Form: MODULE5
    FRM-30085: Unable to adjust form for output.
    then according to some docs, i tried the the following for the trigger
    when-new-form-instance
    declare
         rg_name varchar2(40) := 'emp_rec';
         status number;
         groupid recordgroup;
         it_id item;
    begin
         it_id := Find_Item('empno');
         groupid := create_group_from_query(rg_name, 'select empno from emp');
         status := populate_group(groupid);
         populate_list(it_id, groupid);
    end;
    but yet didnt work... :(
    so how the heck do i get values fetched from the database table into the list item?

    for list items you need to values in the record group, one is the shown value and one is the returned value.
    Check out the online help for the populate_list built-in.
    You'll need something like select ename,ename from emp as the record group query.

  • How to get value in showModalDialog()

    Hi,
    I would like to know how to get value pass into showModalDialog() to be used by the server (using request.getParameter())
    TQ

    please try out this kind of code
    <script language="javascript">
         function trial(){
              var retVal = new Object();
              retVal = ShowModalDialog("ur JSp");
    </script>
    <script>
    <form >
    <input type="hidden" name ="mylink "value= javascript:trial();>
    </form>
    <%
         String str=request.getParameter("mylink");
    %>
    and plz let me know .. if it works

  • How to get value in a web page automatically  and sava output in database

    how to get value this table output is
    row 1, cell 1
    row 1, cell 2
    row 2, cell 1
    row 2, cell 2
    <table border="1">
    <tr>
    <td>row 1, cell 1</td>
    <td>row 1, cell 2</td>
    </tr>
    <tr>
    <td>row 2, cell 1</td>
    <td>row 2, cell 2</td>
    </tr>
    </table>

    Note: This thread was originally posted in the [Java Technologies for Web Services|http://forums.sun.com/forum.jspa?forumID=331] forum, but moved to this forum for closer topic alignment.

Maybe you are looking for

  • New billing system webpage non-compatible with Safari.  Please help!

    Hey guys. A large corporation that is a customer of my father's is switching all of their billing process to a system called Powertrack. Unfortunately their specific webpage is written only for Microsoft Internet Explorer. I tried downloading the lat

  • Transaction MMAM - Change material type

    Does anybody have documentation on transaction MMAM - Change Material type? Many thanks, stefano MAzzarelli

  • How to returning rowid from a dynamic

    which gentleman can do me a favor, tell me how to get the rowid from a returning clause in a dynamic sql. i use one clause as: declare v_rowid char(18); begin sql :='insert into test values('a') returning rowid into :rowid'; execute immediate sql usi

  • Problem with iDVD '08

    When I try to create a new project, the program says "Your Macintosh does not have a supported SuperDrive. Please note that while you will be able to work with iDVD projects, you will not be able to burn a DVD disc." As far as I was aware, I have a D

  • JDeveloper as Rich Client Platform?

    Hello, is it possible to remove all default extensions in Developer or SQL Developer and only use custom extensions? This means, is it possible to do something similar to the Eclipse Rich Client Platform? Has someone already tried this ? kind regards