Collecting values from multiple check boxes with same name

Hi,
I have a jsp-page with one form with several check boxes sharing the same
name (but with different values).
Can I collect the values in an array/list or something?
/jsp-beginner and google ain't my friend in this case

this answer not good enough for you?

Similar Messages

  • Getting result from multiple check boxes

    We want to get the value from checkboxes as
    input type=checkbox name="aa"
    input type=checkbox name="aa"
    now we want to get the value if user checked the box then on else off

    Well the only way you can distinguish between the two is if you give them seperate values
    otherwise all you will get is aa=on - how do you know which one is on?
    <input type="checkbox" name="aa" value="1">
    <input type="checkbox" name="aa" value="2">
    If they click both you will get parameters: aa=1, aa=2
    If they click only one, you will only get one parameter: eg aa=1
    If they click no checkboxes, no parameters are submitted.
    Thats the way it works.
    Cheers,
    evnafets

  • Passing multiple URL parameters with same name

    Hi,
    I have a question which is not entirely related to Java. But although its related HTTP calls, so I thought I might get some ideas here.
    Background:
    I am making HTTP URL call from SAP ABAP code. Its pretty much similar to Java (creating URL connection, setting HTTP headers, connecting, receiving response and everything)
    For example,
    http://service_server:8080/a7/extension.services.SearchRequirements.a7x?RequestStatus=CR&RequestStatus=RR
    Now, this service_server runs a query to database where it uses both these values of "RequestStatus" to form 'OR' condition for a field.
    Issue:
    When I run this URL from browser, it shows XML response containing results for both values. In short, this is the ideal response.
    (I am using getParameterValues(string) at service_server to read multiple values for same parameter)
    But when I see response in SAP system, I see that it is returning data for only one value of 'RequestStatus'.
    I checked the logs of service_server, and I see that it has received only one parameter, not two.
    Question:
    It seems like SAP systems web server is truncating both parameters with same name and passing just one of them to outside server(??)
    Is there any configuration at Web Server side or any HTTP headers to be set so as to avoid this?
    Can anybody suggest something on this?

    I managed to resolve this issue by using HTTP 'Post' method to send the data.
    CALL METHOD CL_HTTP_CLIENT=>CREATE_BY_URL
        EXPORTING
          URL                = L_URL
        IMPORTING
          CLIENT             = L_HTTP_CLIENT
        EXCEPTIONS
          ARGUMENT_NOT_FOUND = 1
          PLUGIN_NOT_ACTIVE  = 2
          INTERNAL_ERROR     = 3
          OTHERS             = 4 .
    "STEP-2 :  AUTHENTICATE HTTP CLIENT
    CALL METHOD L_HTTP_CLIENT->AUTHENTICATE
      EXPORTING
        USERNAME             = 'name'
        PASSWORD             = 'password'.
    "STEP-3 :  SET HTTP HEADERS
    CALL METHOD L_HTTP_CLIENT->REQUEST->SET_HEADER_FIELD
          EXPORTING NAME  = 'Accept'
                    VALUE = 'text/xml'.
    CALL METHOD L_HTTP_CLIENT->REQUEST->SET_HEADER_FIELD
        EXPORTING NAME  = '~request_method'
                   VALUE = 'POST' .
    CALL METHOD L_HTTP_CLIENT->REQUEST->SET_CONTENT_TYPE
        EXPORTING CONTENT_TYPE  = 'application/x-www-form-urlencoded' .
    "SETTING REQUEST DATA FOR 'POST' METHOD
    IF L_PARAMS_STRING IS NOT INITIAL.
       CALL FUNCTION 'SCMS_STRING_TO_XSTRING'
         EXPORTING
             TEXT   = L_PARAMS_STRING
         IMPORTING
               BUFFER = L_PARAMS_XSTRING
         EXCEPTIONS
            FAILED = 1
            OTHERS = 2.
    CALL METHOD L_HTTP_CLIENT->REQUEST->SET_DATA
        EXPORTING DATA  = L_PARAMS_XSTRING  .
    ENDIF.
    "STEP-4 :  SEND HTTP REQUEST
      CALL METHOD L_HTTP_CLIENT->SEND
        EXCEPTIONS
          HTTP_COMMUNICATION_FAILURE = 1
          HTTP_INVALID_STATE         = 2.
    "STEP-5 :  GET HTTP RESPONSE
        CALL METHOD L_HTTP_CLIENT->RECEIVE
          EXCEPTIONS
            HTTP_COMMUNICATION_FAILURE = 1
            HTTP_INVALID_STATE         = 2
            HTTP_PROCESSING_FAILED     = 3.
    "STEP-6 :  READ RESPONSE DATA
    CALL METHOD L_HTTP_CLIENT->RESPONSE->GET_CDATA
            RECEIVING DATA = L_RESULT .
    "STEP-7 : CLOSE CONNECTION
    CALL METHOD L_HTTP_CLIENT->CLOSE
      EXCEPTIONS
        HTTP_INVALID_STATE = 1
        OTHERS             = 2   .
    {code}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Accessing multiple xml elements with same name

    I am having trouble with an xsl stylesheet. This is what one of the rows of my output xml document looks like
            <Row>
                <Num>1</Num>
                <Valuation>Val</Valuation>
                <COMBCHARFLAG>Y</COMBCHARFLAG>
                <CCCOUNT>2</CCCOUNT>
                <CCDESC>CHARDESC1</CCDESC>
                <CCDESC>CHARDESC2</CCDESC>
            </Row>
    Does anyone know how I can access the 2nd CCDESC ("CHARDESC2") . When i run this in the workbench I can only ever access the first CCDESC, it acts like the 2nd isn't there. However I was also using a 3rd party xsl editor called "XMLSpy" to look for other possible solutions and when i render it with XMLSpy, everything is displaying correctly. Is this some sort of limitation of the workbench? Any help would be much appreciated. Thanks
    This is the template i am calling in my xsl.......
    <xsl:template name="for.loop">
    <xsl:param name="i" />
    <xsl:param name="count" />
    <!--begin_: Line_by_Line_Output -->
    <xsl:if test="$i &lt;= $count">
    <tr>
         <td align="center"><xsl:value-of select="CCDESC[position()=$i]"/>
         </td>
         <td align="center">
              <input style="width:110px;" class="Mfieldv-M" name="txtValuation"></input>
         </td>
    </tr>     
    </xsl:if>
    <!begin_: RepeatTheLoopUntilFinished>
    <xsl:if test="$i &lt;= $count">
    <xsl:call-template name="for.loop">
    <xsl:with-param name="i">
    <xsl:value-of select="$i + 1"/>
    </xsl:with-param>
    <xsl:with-param name="count">
    <xsl:value-of select="$count"/>
    </xsl:with-param>
    </xsl:call-template>
    </xsl:if>
    I than call the template as follows from within my  <xsl:for-each select="Row"> statement
                                                                <xsl:call-template name="for.loop">
                                                                <xsl:with-param name="i">1</xsl:with-param>
                                                                <xsl:with-param name="count"><xsl:value-of select="CCCOUNT"/></xsl:with-param>
                                                                </xsl:call-template>

    Muzammil,
    Thanks for the response. I may have explained my situation a little poorly. I am not trying to access the 2nd CCDESC within the workbench via a repeater or such. It is after the XSL renders the page that I don't see the second CCDESC. When the XSL renders the page through Internet explorer i get something that looks like the following......
    Res # 1
    CHARDESC1 
    When I render it in the application XMLSpy it shows both CCDESC's like follows.
    Res # 1
    CHARDESC1 
    CHARDESC2
    In XMLSpy if i change the line of xsl code from      <td align="center"><xsl:value-of select="CCDESC[position()=$i]"/>  to       <td align="center"><xsl:value-of select="CCDESC[2]"/> the page is rendered in XMLSpy with both labels the same as follows.
    Res # 1
    CHARDESC2 
    CHARDESC2
    If i do that same change in the workbench and render the page through IE I get no label results....
    Res # 1
    Thanks

  • Multiple Local Users With Same Name

    Hi guys, this is the screen saver after i upgraded to Yosemite. I knew wifi have problem, but i'm still okay with it. Another problem that i'm facing now is this!
    I don't really understand what's the number meaning behind my username which is the number (7), i've never seen this before. Sometime it will turn to 2, 3, 4, or maybe 5. This problem force me to quit some software because it said i'm using same license with multiple user, but i'm the only one who using this username!
    I don't understand what happen with this, i've try to read and change almost everything in the preferences. I've try to google everything too, can anyone help me? I really don't want to format my macbook. I've never register same username even i'm in a office.
    Really appreciate if anyone can guide me and tell me what should i do! Thanks!

    Send Apple feedback. They won't answer, but at least will know there is a problem. If enough people send feedback, it may get the problem solved sooner.
    Feedback
    I've gotten some relief by renaming it in System Preferences/Sharing and then clicking Edit tab to make sure it is correct there. May not hold.

  • "Open with" shows multiple app's with same name; 2 at most are valid

    I use Preview as my default JPEG viewer application; when I want to edit I used another application and use "Open With". I have a backup drive mounted and the app's backed up show... that's a nuisance, but acceptable.
    However, there are 5 listings for some applications, yet only 2 possible copies (as verified by Spotlight). How can I clean-up the list? Is there a way to tell an app's source (in the menu)?

    A long shot perhaps, but at the bottom of the Open With submenu you will see "Other...". If you go in there there is a setting for either "All Applications" or a specific application folder to be selected. Have you assigned the latter and does it help?

  • While saving multiple attachments from mail, files with same name are added and not replaced

    While saving Multiple Attachments from Mail, existing file with same name are not overwritted but new files are added in the folder.

    Bjørn Larsen a écrit:
    Hi all
    Hope to get some help with Elements Organizer.
    I have 12-15 years of digital photos that I now want to import into my newly aquirede Adobe Elements Organizer / Photoshop. Since my Nikon names the files with continous numbers from 0001 to 9999 I have multiple files with the same name although they are not alike at all. My previous software had no problems with that since I keep the photos in separate file folders based on import date. I generally import photos after each event and so name the folder with the date and some event info (e.g. 2014.12.24 - Christmas at grandparents).
    That is a common situation, I have the same limitation for files not going over 9999 on my Canons...
    Now - when I import my photos into Elements Organizer I get a lot of error messages with "same name exist .....) Hmmmmmmm
    Please sate the exact wording of the error message, I have never seen a message stating 'same name exist...' or equivalent; only messages about files already in the catalog. Files already in the catalog mean that some files have the same 'date taken' and file size in Kb.
    Any suggestions. I'm using a mac and tried to rename files based on date taken. The mac can do that but it takes ages to go into each folder and run the renaming script there.
    I also use a similar folder creation scheme (such a date naming is the default for the downloader). That way I never get a message about duplicates for the same file names.
    However - I can't be the first or only person with this problem so I figure that some workaround must be known out there. Maybe the import action can recognize date taken or - well. Thank you very much in advance if you can help me out here.
    You can alsways set the downloader to rename the imported files with a unique new name, there are many options in the 'advanced' dialog of the downloader. I don't know about Macs, but I don't thing there is a difference.

  • How to separate two contact with same name

    Hi, anyone knows how to separate two contacts with same name in Contacts?  Actually they are two persons from two gmail contacts with same name but different contact numbers, different emails....etc, but Contacts assume they are same person and merge them as one!

    FG,
    In Lion, you have the File > Duplicate option. You will then have two copies of your document open, and the one on top will have the temporary filename "OriginalFileName copy", and your next responsibility is to File > Save (or Command-S) and rename the duplicate. At this point, you edit the copy's name, to perhaps ...copy 1, or whatever you wish. The document you had open when you initiated the File > Duplicate will still be there on your screen, waiting for you to Close it or continue editing.
    Jerry

  • Getting multiple values from a list box

    Hi,
    I am not able to get multiple selected values from a list box using the getParameterValues(). I used the following code..
    String[] names=request.getParameterValues("lname");
    can anyone tell me what the error is or is there any other way i can get multiple selected values from a list box.
    Thanks
    Satish

    Fragment 1
    This is the JSP Code am using for testing
    <%
    String[] name =request.getParameterValues("D1");
    if(name.length==1)
    String value=name[0];
    Instead of name.lenght==1 try with name!=null
    Fragment 2
    out.println(value);
    replace the above fragment with
    %>
       <%-- print result -->
       <%=name[0]%>
    <%
    Fragment 3
    else
    %>
    The list box D1 is a multiple select list box.
    If it still doesn't work, check that the checkboxes have the same name as well as different values
    <input type="checkbox" name="D1" value="1">
    <input type="checkbox" name="D1" value="2">I hope this helps :-)
    Good luck
    touco
    ps: i want duke

  • How to get all checked values from a chaeck box

    Hello
    In my app i have a checkbox called P10_CID with static lov like
    STATIC2:one;1,two;2,three;3,four;4,six;6
    my question is when i check more than one option
    i can not get that value.
    How is it possible to see all the values of the check box that are checked ?
    Regards
    Aris

    Hi Aris,
    Do you have to have checkboxes? Can you use a multiselect list instead?
    If you can, then the following excerpt from the user guide may help you:
    Using HTMLDB_UTIL.STRING_TO_TABLE to Convert Selected Values
    Suppose you had a report on the EMP and DEPT tables that is limited by the
    departments selected from a Department multiple select list. First, you create the
    multiple select item, P1_DEPTNO, using the following query:
    SELECT dname, deptno
    FROM dept
    Second, you return only those employees within the selected departments as follows:
    SELECT ename, job, sal, comm, dname
    FROM emp e, dept d
    WHERE d.deptno = e.deptno
    AND instr(':'||:P1_DEPTNO||':',':'||e.deptno||':') > 0
    Regards
    Andy

  • Single or multiple check box values displayed in a textbox

    Hi Experts!
    I'm using the following script to display the values of check boxes in a text field.  I would like the word "and" to separate the values if two check boxes are selected. If more than two boxes are selected I want the values to be separated by a comma and then the last value be separated by "and".  Example of two check boxes selected:  A and B.  Example of two or more: A, B, C, and D.  Can this be done?
    form1.page1.page1SF.programs::calculate - (JavaScript, client)
    //displays the values of check boxes named programCB
    var aChkBx = [];
    var vChecks = programCB.all;
    for (var a=0; a<vChecks.length;a++){
    if(!vChecks.item(a).isNull) {
    aChkBx.push(vChecks.item(a).rawValue);
    this.rawValue = aChkBx.join(", ");

    So, the way I see it, you actually have four scenarios. Nothing is checked, one item is checked, two items are checked, and three or more items are checked.
    Here's how I did it.
    I have four checkboxes all with the same name, cb. (You could have many more, and it wouldn't matter as long as they're all named the same thing.) I'm presuming that you will use the captions from the checkboxes as the text you want to enter. I called my text area where I enter the information tfSentence. (It's not a text field, it's just called "Text" in the Object Library.)
    //we need to count how many boxes are checked
    var checked = 0;
    for (i=0; i<=cb.length; i++){
      if (xfa.resolveNode("cb["+i+"]").rawValue == 1) checked ++;
    //create a string variable to store our sentence
    var str = "";
    //look at the checked variable and choose our case from that
    switch(checked){
      case 0:
        //you may want to do more than just type out a sentence here, like a message box
        tfSentence.rawValue = "Nothing was selected";
        break;
      case 1:
        //you can set text that will appear before your list of items here
        //str = "preliminary text";
        for (i=0; i<=cb.length; i++){
          if (xfa.resolveNode("cb["+i+"]").rawValue == 1) str += xfa.resolveNode("cb["+i+"].caption.value.#text").value;
        //you can set text to appear after your list of items here
        //str += "ending text";
        tfSentence.rawValue = str;
        break;
      case 2:
        //str = "preliminary text";
        for (i=0; i<=cb.length; i++){
          if (xfa.resolveNode("cb["+i+"]").rawValue == 1){
            if (checked == 1) str += " and " + xfa.resolveNode("cb["+i+"].caption.value.#text").value;
            else str += xfa.resolveNode("cb[+i+"].caption.value.#text").value;
            checked--;
        //str+= "ending text";
        tfSentence.rawValue = str;
        break;
      default:
        //str = "preliminary text";
        for (i=0; i<=cb.length; i++){
          if (xfa.resolveNode("cb["+i+"]").rawValue == 1){
            if (checked == 1) str += "and " + xfa.resolveNode("cb["+i+"].caption.value.#text").value;
            else str += xfa.resolveNode("cb["+i+"].caption.value.#text").value + ", ";
            checked--;
        //str += "ending text";
        tfSentence.rawValue = str;
        break

  • LOV with auto suggest and multiple check boxes

    Is it possible to implement LOV with auto suggest and multiple check boxes using ADF faces components?. Any alternative implementation/pointers are appreciated.
    Regards,
    Surya

    Hi,
    build it yourself as a task flow opened in a popup. see: http://www.oracle.com/technetwork/developer-tools/adf/learnmore/69-custom-lov-with-btf-276178.pdf
    Frank

  • Single or multiple check box values displayed in a text field

    My apologies, this may be a duplicate discussion.
    I'm using the following script to display the values of check boxes in a text field.  I would like the word "and" to separate the values if two check boxes are selected. If more than two boxes are selected I want the values to be separated by a comma and then the last value be separated by "and".  Example of two check boxes selected:  A and B.  Example of two or more: A, B, C, and D.  Can this be done?
    form1.page1.page1SF.programs::calculate - (JavaScript, client)
    //displays the values of check boxes named programCB
    var aChkBx = [];
    var vChecks = programCB.all;
    for (var a=0; a<vChecks.length;a++){
    if(!vChecks.item(a).isNull) {
    aChkBx.push(vChecks.item(a).rawValue);
    this.rawValue = aChkBx.join(", ");

    My apologies, this may be a duplicate discussion.
    I'm using the following script to display the values of check boxes in a text field.  I would like the word "and" to separate the values if two check boxes are selected. If more than two boxes are selected I want the values to be separated by a comma and then the last value be separated by "and".  Example of two check boxes selected:  A and B.  Example of two or more: A, B, C, and D.  Can this be done?
    form1.page1.page1SF.programs::calculate - (JavaScript, client)
    //displays the values of check boxes named programCB
    var aChkBx = [];
    var vChecks = programCB.all;
    for (var a=0; a<vChecks.length;a++){
    if(!vChecks.item(a).isNull) {
    aChkBx.push(vChecks.item(a).rawValue);
    this.rawValue = aChkBx.join(", ");

  • Value to multiple sprites through the same parameter

    I'm going to ask the same question "
    "contains" doubt in hexadecimal color value?" but in a
    different way, because I figured out that the solution is simpler
    that I thought, and the solutions goes by other way. I have this
    behavior:
    property pTargetSprite, pBlendValue
    on getPropertyDescriptionList me
    list = [:]
    addProp list, #pTargetSprite, [#comment: "Target Sprite:",\
    #format: #integer, #default: VOID]
    addProp list, #pBlendValue, [#comment: "Blend Value:",\
    #format: #integer, #default: 100]
    return list
    end
    on mouseDown me
    sprite(pTargetSprite).blend = pBlendValue
    end
    I would like to enter MULTIPLE sprites for 1 parameter, that
    is to say when the dialog box of the behavior appears and ask me
    the "Target Sprite:", I would like to input ...let's say 1 , 2 , 3
    , ... whatever numbers I want. Therefore, the blend values of that
    sprites will change according to the input Blend Value. Right Now
    is working perfect, but of course with only ONE sprite, but I want
    to be able to assign that Blend Value to multiple sprites over the
    same parameter.
    I guess it must be very simple, but I cannot get the answer
    anywhere in my brain, nor my director book, nor in the forums.
    Thanks!!!

    You have several options here. You can do as you suggest,
    create a list
    of the sprite numbers to change and then tell each of those
    sprite's
    blend value to change.
    Another method is to write a function in the behavior that
    you attach to
    each sprite and then use sendAllSprites() to fire each of
    those
    functions. If you are attaching behaviors to each sprite this
    may be the
    way to go.
    For method 1, you could amend your behavior like this:
    property spriteList
    property blendValue
    on getPropertyDescriptionlist
    myPropList = [:]
    myPropList.addProp(#spriteList,[#comment:"enter the sprite
    channel
    numbers to use, separated by
    commas:",#format:#integer,#default:"1,2,3"])
    myPropList.addProp(#blendValue, [#comment: "Blend Value:",\
    #format: #integer, #default: 100])
    return myPropList
    end
    on beginSprite me
    spriteList = stringToList(spriteList)
    end
    on stringToList(thisString)
    oldDelim = the itemDelimiter
    the itemDelimiter = ","
    thisManyItems = thisString.item.count
    tempList = []
    repeat with n = 1 to thisManyItems
    tempList.add(thisString.item[n])
    end repeat
    the itemDelimiter = oldDelim
    return tempList
    end
    on mouseUp me
    thisMany = spriteList.count
    repeat with n = 1 to thisMany
    sprite(n).blend = blendValue
    end repeat
    end
    for method 2 you could use something like this in each
    sprite's behavior:
    property blendValue
    property thisSprite
    on getPropertyDescriptionlist
    myPropList = [:]
    myPropList.addProp(#blendValue, [#comment: "Blend Value:",\
    #format: #integer, #default: 100])
    return myPropList
    end
    on beginSprite me
    thisSprite = me.spriteNum
    end
    on changeValue me
    sprite(thisSprite).blend = blendValue
    end
    and then you can call this second method from a mouse event:
    on mouseUp me
    sendAllSprites(#changeValue)
    end
    and every sprite that contains that function in the frame
    where it is
    called will execute.
    Rob
    Rob Dillon
    Adobe Community Expert
    http://www.ddg-designs.com
    412-243-9119
    http://www.macromedia.com/software/trial/

  • Multiple check boxes in an update form

    I have a database of the membership of a club. One field in the database is input by checking multiple check boxes. When the insert member record is submitted and multiple check boxes are selected, the information becomes an array of text separated by commas. When the user goes back to the update form, the check boxes are not showing checked in the appropriate fields. Please go to my test site where you will be able to see the code that I have created so far: http://www.usreboot.com/phphelp.php. You will need a user name and password to look at the update record page. Here you go: user name: wyane, password: wayne. I have submitted this request in the past and have not found success so far. Thanks for your help, Wayne Rowlands

    Thanks for getting back with me. I do have two tables. One table is the "members" table where all the information for the members is stored. One of the columns is "currentClubPositions". The database has another table which is "positions" which has the list for the positions that a member of the club could serve on. Members of the club may be serving on a number of positions at once, therefore the check boxes. Also, the club is adding and deleting positions over time, so I wanted an easy way to add them and delete them without having to go into phpmyadmin to do this. I have created a form that updates the "positions" table. The check boxes that show up in the insert member record and update member record are dynamic so that when the table "positions" changes, the forms change dynamically as do the queries to sort the database change dynamicaly. When the check boxes are entered, I use the implode function to make the values an array of text separated by commas and that value is inserted in one field of the members table named "currentClubPosition". I am all ears to hear a better way. Take a look at the web pages (see the original post) that I have created and you will see how all this ties together. Thanks, Wayne Rowlands

Maybe you are looking for