How to loop to get value of all checked checkboxes?

I am a non-techic trying to fix something for work. Your help is really appreciated.
I have a form with checkboxes (4 check boxes). Everything sumbits fine. SQL db is updated perfectly and data is displayed on webpage w/o any problem. However when I go to edit an entry, on the edit form, (if more then one checkbox were selected oringally), non of the checkboxes are checked. If only one checkbox was selected orinally, that checkbox is selected. What am I missing? I know I am suppose to use loop to get all checked checkbox values, but I have no idea how.
Here is my code so far.
<input type="checkbox" name="colors" value="red" <cfif #getResultSet.colors# EQ "red">checked</cfif>>red
    <input type="checkbox" name="colors" value="blue" OR<cfif #getResultSet.colors# EQ "blue">checked</cfif>>blue
    <input type="checkbox" name="colors" value="green" OR<cfif #getResultSet.colors# EQ "green"></cfif>>green
    <input type="checkbox" name="colors" value="yellow" OR<cfif #getResultSet.colors# EQ "yellow">checked</cfif>>yellow

JayYaj wrote:
However when I go to edit an entry, on the edit form, (if more then one checkbox were selected oringally), non of the checkboxes are checked. If only one checkbox was selected orinally, that checkbox is selected.
You've given all the checkboxes the same name. Give them each a unique name and you will be able to access them individually. Current standards also require a unique ID, which can (but does not have to) be the same as the name.
The "OR" characters in your code are not doing anything. You can safely delete them.

Similar Messages

  • How do I stop getting copied on all emails I send?

    How do I stop getting copied on all emails I send?  Help

    Go back into your email settings and make sure you don't have bcc turn on.

  • How to change drill filter values of all reports at the same time

    Hi,
    The Webintelligence users in our environment usuallly use drill filters in their document's reports. We'd like to find a way to change the drill filters' values of all reports when one value is selected. I mean, we need a work around to change the drill filters of all reports at the same time.
    We are using Business Objects XI 3.1 (a lot of webintelligence documents available, over than 2500).
    Does someone know a way to do that? I've already looked for that a lot, but I couldn't find anything.
    Thanks in advance,
    Gustavo Borges

    Hello Gustavo,
    as you refer to a Webi problem I recommend to post this query to the [BusinessObjects Web Intelligence|SAP BusinessObjects Web Intelligence; forum.
    This forum is dedicated to topics related to the creation and design of Web Intelligence documents using the Web Intelligence Report Panels. This includes areas such as universe connectivity, prompts, charting, formatting, filters, and formulas.
    It is monitored by qualified technicians and you will get a faster response there.
    Also, all Webi queries remain in one place and thus can be easily searched in one place.
    Best regards,
    Falk

  • How to get values of all input text of a form?

    Hi,
    I would like to know how to get all input text value of a form?
    I try this:
            List values = new ArrayList(); 
            values = getBindings().getAttributeBindings(); 
            for (Iterator iterator = values.iterator(); iterator.hasNext();) {
                Object o = iterator.next();
                if (o != null) { 
                    if (o instanceof FacesCtrlAttrsBinding) { 
                        System.out.println("Trace iterator=" + ((FacesCtrlAttrsBinding)o).getName());
    src
    In my jspx, I use panelTabbed component which is in af:form
    With this code, I get all bindings name.
    So I change the [structure |http://h.imagehost.org/0922/jdev.png] putting af:form in each item of my af:panelTabbed without succes.
    The code trace all bindings again, and I just want to get the input text of the form (like *$_POST*, or *$_GET* in php)
    How to do that?
    Thanks for your help.

    Hi,
    I try this:
    private UIComponent getUIComponent(String name) { 
          FacesContext facesCtx = FacesContext.getCurrentInstance(); 
          return facesCtx.getViewRoot().findComponent(name) ; 
    src
    I post the structure again.
    I try:
    // f1 id of af:form
    UIComponent test =  getUIComponent("f1");
    test is not null
    // pfl1 id of af:panelFormLayout
    UIComponent test =  getUIComponent("pfl1");
    but here test is null
    I try
    // f1 id of af:form
    // pt1 id of af:pageTemplate
    // pt2 id of af:panelTabbed
    // sdi1 id of af:showDetailItem
    // ps1 id of af:panelSplitter
    // pgl32 id of af:panelGroupLayout
    // pfl1 id of af:panelFormLayout
    UIComponent test =  getUIComponent("f1:pt1:pt2:sdi1:ps1:pgl32:pfl1");but I have this:
    Error 500--Internal Server Error
    javax.servlet.ServletException: java.lang.IllegalArgumentException: f1So I add
    private static final char SEPARATOR_CHAR = ':';But I have the same error.
    getUIComponent returns null with pt2,sdi1, ps1, pgl32, pfl1 and not null with f1, pt1.
    I don't know why...
    How can I get children (af:inputText) of pfl1 ?
    Thanks

  • How to loop with varying values depending on where you are in the loop

    Hi,
    I have need of loops / nested loops that pick different figures depending on where you are in the loop.
    The whole function needs to run through 'ml' times. 'ml' is a dynamic figure.
    Loop 1 = While the loop is within the first 12 iterations, 'exconemp' must equal 100. For iterations 13 - 24, 'exconemp' must equal 102.5, for 25 - 36 it will be 105.06, for 37 - 48 it will be 107.69. This needs to change every 12th iteration until it has reached 'ml'. The calculation takes the value of the previous 'exconemp' and then multiplies that by 0.025.
    Loop 2 = While the loop is within the first 120 iterations, 'abc' must equal 0.015 and any further iterations must use 0.01. This must also work in a way to figure out whether 'ml' is higher or lower than 120 and work accordingly.
    My main issue is this - how do I get the loops to run through as this:
    While the iteration is < 12, do this, THEN take the final figure (12th iteration) and start on 13 - 24, do this THEN etc etc.
    How do I produce a THEN statement? I can get the code to pick up the final values, but not change along the way.
    I think that I may be better creating an array for Loop 1, but I am not entirely convinced of this. I also think it would be better/tidier if I can get 'month 1 total' and 'month 2 total' into the loops, but am not sure on how to do this.
    The values that I need to produce are (only first 36 shown):
    1 - 12 = 125.55, 251.65, 378.31, 505.52, 633.29, 761.63, 890.53, 1019.99, 1150.03, 1280.63, 1411.81, 1543.57
    13 - 24 = 1679.05, 1815.12, 1951.79, 2089.06, 2226.93, 2365.41, 2504.50, 2644.20, 2784.52, 2925.45, 3067.00, 3209.18
    25 - 36 = 3355.19, 3501.85, 3649.15, 3797.11, 3945.71, 4094.96, 4244.87, 4395.44, 4546.68, 4698.57, 4851.14, 5004.38
    var ml = 240 // dynamic figure, multiple of 12 up to 780
    var exconemp;
    var exconem = 100;
    var inf = 0.025;
    var tree;
    var tec;
    var power;
    var fvis;
    var abc;
    var fvee;
    var tfv;
    function myfunction() {
    //Loop 1
    //while (ml <= 12) {
      exconemp = exconem;
    //while (ml > 12) {
    // exconemp = exconem*inf;
    //end Loop 1
      trace("exconemp=", exconemp); // employees contribution
    tree = exconemp/(1-0.2)-exconemp;
    tec = exconemp + tree;
      trace("tree", tree);
      trace("tec", tec);
    power = Math.pow(1+0.07, 1/12);
    //Loop 2
    //while (ml <= 120) {
      abc = 0.015;
    //while {
      //abc = 0.01;
    //end Loop 2
    fvis = power*(1-abc/12);
    trace("fvis=", fvis);
    fvee = tec*fvis;
    trace("fvee=", fvee); // month 1 total
    tfv = (tec+fvee)*fvis;
    trace("tfv=", tfv); // month 2 total
    for (var i:Number = 0; i < ml; i++)
          tfv = (tec+tfv)*fvis;
      trace("tfvloop=", tfv);
    I hope that I have explained this well enough.
    Many thanks in advance.

    I think this will do it although I am not quite getting the numbers you posted.
    stop();
    var ml = 48; // dynamic figure, multiple of 12 up to 780
    var exconemp;
    var exconem = 100;
    var inf = 0.025;
    var tree;
    var tec;
    var power;
    var fvis;
    var abc = 0.15;
    var fvee;
    var tfv;
    myfunction();
    function myfunction()
        exconemp = exconem;
            for(var index:uint = 1; index <= ml; index++)
                trace(index + "--------------------------------");
                    tree = exconemp/(1-0.2)-exconemp;
                    tec = exconemp + tree;
                    power = Math.pow(1+0.07, 1/12);
                    fvis = power*(1-abc/12);
                    fvee = tec*fvis;
                        if(index == 1)
                            trace("month 1 total=", fvee);
                        else if(index == 2)
                            tfv = (tec+fvee)*fvis;
                            trace("month 2 total=", tfv); // month 2 total
                        else
                            tfv = (tec+tfv)*fvis; //now that we are here the tfv self perpetuates on itself
                            trace("month " + index + " total=", tfv); // month n total
                if(index % 12 == 0)
                    exconemp = exconemp*(1+inf);
                    trace("changed exconemp to: " + exconemp);
                if(index % 120 == 0)
                    abc = .01;
                    trace("changed abc to: " + abc);

  • How to save  particular variable values for all users

    Hi Experts,
    I have variables posting period with user entry default value  and fiscal year(with entry vulaue mandataory)in 30 queries.Now user wants to set this values i.e.posting period to 0 -16 (interval) and fiscal year to 2008.
    whoever opnes the workbook he should  get the the defualt values as posting period 0-16 and fiscal
    2008 in variable selection screen.unless user enters the values it should remain same Please suggest me how to do that.Is this changes should be saved as vaintat in variable selection screen and transported or shall I do this change for all thse quesries or shall I change the variable value to default setting in variable propeties so that changes should be visible to all 30 queries .Please suggest....!!!!
    Regards
    Prasad

    Hi Prasad,
    Just go to that variables in query designer, and give the default values for the variables as 0-16 and for Fiscal year 2008.
    http://help.sap.com/saphelp_sem40bw/helpdata/EN/ae/1e9b3c334d8c15e10000000a114084/content.htm
    Now while generating the query in the variables screen select the personalization, so that these values will be fixed and personalized for the query.
    http://help.sap.com/saphelp_nw04/helpdata/en/3f/30ae3d47afd652e10000000a114084/frameset.htm
    http://help.sap.com/saphelp_nw04s/helpdata/en/3f/30ae3d47afd652e10000000a114084/frameset.htm
    Rgs,
    I.R.K

  • How to loop through token values

    I'm trying to create a simple loop that runs through a bunch
    of comma delimted values in a string and adds them together. What
    is the best way to do this?
    Currently, my code looks something like this
    <cfset basevalue = "0">
    <cfset count = "1">
    <cfset token = getToken(myString,count,",")>
    <cfloop condition = "token NEQ NULL">
    <cfset token = getToken(myString,count,",")>
    <cfset basevalue = basevalue + token>
    <cfset count = count + 1>
    </cfloop>
    This doesn't seem to be working. Any ideas?

    quote:
    Originally posted by:
    Dan Bracuk
    This is equally simple.
    <cfset thesum = 0>
    <cfloop list="#mystring" item="token">
    <cfset thesum = thesum + token>
    </cfloop>
    How does this know what the token is? By that I mean what the
    delimiter is?

  • How to giv diff varible values for all the queries in a Workbook?

    Hello BI Gurus,
              I have an issue with the variable in a the workbook,
    I have a workbook in which 4 queries are inserted in the same sheet one below the other and all these queries has same hierarchy variable (same technical name). In all these queries uses different hierarchies but same selection variable.
              Now the issue is , when I refresh the workbook the first queryu2019s variable pops up selection option for the hier variable and when I enter the value this first query runs fine but it carries the same value to another query and fails as the 2nd query uses diff hier.
    All I need is, is there any way by which these queries pop up selection screen separately for every query in workbook?
    Thanks a lot..! have a great day!

    Hi,
    You should open workbook settings and remove tick for display dubplicate veriables omly once.
    Regards,
    Veronika.

  • How to pass some default values in all elements which are blank in xslt.

    Hi,
    Help needed:
    Scenario:
    After .xslt transformation, there are some elements which are being mapped but left blank. I want to assign some default values to it like '0'. How to do that.
    Thanks.

    One solution would be something like this...
    http://remysharp.com/2008/08/15/how-to-default-a-variable-in-xslt/
    Or you can use a template like this...
    <xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:template match="node()|@*">
         <xsl:copy>
           <xsl:apply-templates select="node()|@*"/>
         </xsl:copy>
    </xsl:template>
    <xsl:template match="Title">
        <xsl:choose>
            <xsl:when test="string-length(normalize-space(.)) = 0">
                <Title>default</Title>
            </xsl:when>
            <xsl:otherwise>
                <xsl:copy-of select="."/>
            </xsl:otherwise>
        </xsl:choose>
    </xsl:template>
    </xsl:stylesheet>For every empty "Title" node, this template will add <Title>default</Title>... If the Title has value it won't be changed... You can change this to your fields/your defaults... If you need default for other field just add another template in the same transformation...
    Cheers,
    Vlad

  • How get values of columns for selected rows in SortingTable

    Hi,
    is possible to get values of more columns for selected rows? I have SortingTable that have 1st column loaded from list and 2nd and 3rd columns are text areas where user must write some text. I need way how to get values from all three columns for selected rows.
    My table looks like this:
    System name I User Account I  User Password
    system1 ...............jblack ............. passw1
    system2 ...............pdowe..............p@ssw
    system3 ...............ekie................. pas123
    Column System name is loaded from list, columns User Account and User Password are Text class. How can I get values for all three columns in case that I select e.g. system1 or system1 & system2?
    I read [this post|http://forums.sun.com/thread.jspa?forumID=764&threadID=5220609] but there is described selection only for one column.
    Code of my SortingTable is following:
    <Field name='tblDalsiSystemy'>
                   <Display class='SortingTable'>
                       <Property name='align' value='center'/>
                       <Property name='sortEnable' value='false'/>
                       <Property name='selectEnable' value='true'/>
                       <Property name='pageSize' value='5'/>
                       <Property name='pageButtonAlign' value='center'/>
                       <Property name='columns'>
                           <List>
                               <String>System name</String>
                               <String>User Account</String>
                      <String>User Password</String>
                           </List>
                       </Property>
                   </Display>
                   <FieldLoop for='y' in='lstSystemList'>               
                     <Field name='SystemName'>
                         <Display class='SortingTable$Row'>
                             <Property name='key'>
                                 <ref>lstSystemList</ref>
                             </Property>
                         </Display>
                         <Display class='Label'>
                             <Property name='align' value='center'/>
                             <Property name='value'>
                                 <ref>y</ref>                            
                             </Property>
                         </Display>
                     </Field>
                     <Field name='UserAccount'>
                         <Display class='SortingTable$Row'>                        
                         </Display>
                         <Display class='Text'>
                             <Property name='size' value='10'/>
                             <Property name='value'>                            
                             </Property>
                         </Display>
                     </Field>
               <Field name='UserPassword'>
                         <Display class='SortingTable$Row'>                        
                         </Display>
                         <Display class='Text'>
                             <Property name='size' value='10'/>
                             <Property name='value'>                            
                             </Property>
                         </Display>
                     </Field>
                   </FieldLoop>              
               </Field>Getting value is performed by:
    <ref>tblDalsiSystemy.selected</ref>Any help?
    Thanks
    Petr

    Hi Ivan,
    thanks for your advice - it works.
    Here is my final code:
    <Field name='tblDalsiSystemy'>
                   <Display class='SortingTable'>
                       <Property name='align' value='center'/>
                       <Property name='sortEnable' value='false'/>
                       <Property name='selectEnable' value='true'/>
                       <Property name='pageSize' value='5'/>
                       <Property name='pageButtonAlign' value='center'/>
                       <Property name='columns'>
                           <List>
                               <String>System name</String>
                               <String>User Account</String>
                      <String>User Password</String>
                           </List>
                       </Property>
                   </Display>
                   <FieldLoop for='y' in='lstSystemList'>               
                     <Field name='SystemName'>
                         <Display class='SortingTable$Row'>
                             <Property name='key'>
                                 <ref>lstSystemList</ref>
                             </Property>
                         </Display>
                         <Display class='Label'>
                             <Property name='align' value='center'/>
                             <Property name='value'>
                                 <ref>y</ref>                            
                             </Property>
                         </Display>
                     </Field>
                     <Field name='Account[$(y)].login'>
                         <Display class='SortingTable$Row'/>
                         <Display class='Text'>
                             <Property name='size' value='10'/>
                             <Property name='value'>                           
                             </Property>
                         </Display>
                     </Field>
                     <Field name='Account[$(y)].passwd'>
                         <Display class='SortingTable$Row'/>
                         <Display class='Text'>
                             <Property name='size' value='10'/>
                             <Property name='value'>
                             </Property>
                         </Display>
                     </Field>
                   </FieldLoop>              
               </Field>Maybe it could be helpful for somebody another :-)
    Petr

  • Getting the value of a check box - annoying error

    Hi guys,
    Ive got a web page with sets of hidden variables and check boxes which relate to different courses, but when I try and itterate through the value of the check box to see if it is checked or not im getting an outofIndexArray error because im using
    for(int i=0; i<paramValues.length;i++)
    { which relates to the number of courses which does agree with the number of check boxes, but not when they are unchecked.
    i.e. when some of the boxes are not checked then it gives this error, however when all are checked it is fine.
    How do I get it to not give this error, i.e. how do I set the value of a check box when it is not checked as on several web pages it shows how to set the value when they are checked.
    thanks
    tzaf

    i don't see the error, can you post some more code?
    what is paramValues?
    you iterate over the number of checkboxes?
    every checkbox can be selected or deselected (boolean isSelected())
    how can there are an exception?
    what is the array where the exception occur

  • Loop over form values & insert into db

    Form
    prod_id     prod_name       prod_price    prod_status
    001         product 001     1.00          1            
    002         product 002     2.00          1      
    003         product 003     3.00          0      
    004         product 004     4.00          0      
    Form Dump
    prod_name      product 001,product 002,product 003,product 004
    FIELDNAMES     prod_id, prod_name, prod_price, prod_status
    prod_price     1.00,2.00,3.00,4.00
    prod_status    1,1,0,0
    prod_id        001,002,003
    I want to update a few fields, prod_price and prod_status. I submit these values to my update page but I'm not sure how to loop over these values and update by the prod_id. In my update page I'm using cfdump and I see the structure of the form, the fieldnames as well as the prod_id, prod_name, etc and their values.
    My question is how do I loop over these form values so I'll be able to update by each prod_id? I've played around with looping over the form collection values but no luck.

    When I do stuff like this, I append the "id" value to the end of each form field.  That enables me to ensure the other fields match up.
    When processing the form, I generally do something like this:
    <cfloop list="#form.fieldnames# index="ThisField">
    <cfif left(ThisField, 9) is "prod_name">
    <cfscript>
    ThisID = removechars(thisfield, 9);
    ThisName = form["prod_name" & ThisID];
    same for other fields
    Then do something with those variables.

  • How to view OK CODE VALUES

    how to find OK CODE values for all like page up page down
    etc any pgm to view all possible ok code values.

    Hi Karthik,
    I don't think there's anything called <i>possible ok-code values</i>. Any ok-code value is possible. Depends on what the code in the PAI module(s) is. Technically, you can even have ok-code values when there's no button with that function code in any screen. However this is not generally practised for obvious reasons.
    You can go to SE80, give the program name and see what are all the GUI statuses that the program uses. That will give you the information about the various ok-codes in the toolbars. But if your program has got some buttons on the screens as well, then I don't think there's any utility which will tell you about all those function-codes.
    Any particular reason why you want to have this information ?
    Regards,
    Anand Mandalika.

  • How to install pkg-get

    hi, i've installed pkg-get, and in the how-to that i found he ask me to modify the path.
    i've tried this #PATH=/tmp:/opt/csw/bin:/usr/sbin:/usr/bin:/ce/que/vous/voulez/rajouter/au/path/in :
    #vi /etc/default/loginand when i tape in the terminal after saved "login":
    #which pkg-get it don't find and it answer that :
    no pkg-get in /tmp /opt/csw/bin /usr/sbin /usr/bin...sorry for my english i'm french. if you wan't more information don't hesitate .
    thanks, how can run pkg-get ?

    Hello,
    all you need to do is add the following lines into ~/.profile
    For example if you are runing as root then edit /.profile and put the following lines in /.profile:
    PATH=$PATH:/opt/csw/bin/
    export PATH
    Save the file and logout and log back in. This should let you use the pkg-get command from the root account.
    You can check which script you are using by typing:
    # which pkg-get
    This sould bring back:
    /opt/csw/bin/pkg-get
    HTH
    Tom

  • How an SSCC number gets generated

    Hi Gurus,
    I am now learning HUM. Actually I dont have access to client system. I am working on sandbox and I want to know how an SSCC number gets generated. I checked Number range object LE_SSCC. I did not not understand the relevence because in LE_SSCC, current number is 290 and the Internal HU number is 1500. Number range object HU_VEKP is working fine with internal HU Number. The SSCC numbers are incremented some times with 7 and some times with 17. No where I could see the source settings for this.
    I hope that SSCC Number is copied from the box sent by vendor through bar code readear. If that is the case it should be randomly changing. There should not be any fixed increment. What is the guarentee that it is not repeated?
    Please throw some light on SSCC Number generation.

    Hi Nagesh,
    You define the number range in t-code SNRO. You can define an external number range there for you vendor received SSCC numbers. The skipping in the number range can occur baseed upon what is in the number range buffer in SAP. When you log in you are assigned numbers from the number range and when someon else signs in they are assigned numbers from the range. These numbers may not be sequential.
    Regards,
    Steve

Maybe you are looking for

  • Connecting a Macbook to an external display

    My imac broke. I have a white macbook 2.16ghz intel core 2 duo with 2 gb of memory. While I assume I can connect my macbook to an external monitor, I'm wondering if I can connect it and improve the resolution. I do a lot of work on photoshop and need

  • Logic Express won't start at all

    Howdy! I just installed the Snow Leopard and downloaded the updated to 10.6.2 right away and then continued installing iLife, iWork and Logic Express 9 - without installing the OS updates yet. After restarting I can't start neither Logic nor GarageBa

  • [Solved] Cannot burn CD's with LG drive on new system

    Arch x86_64 (up-to-date) on a Zotac GF-8200-C-E miniITX motherboard, Athlon II X2 240 CPU with an LG SATA GH22NS50 DVD+-RW drive. The drive reads CD's fine, but cannot burn anything successfully. The drive works fine on a WinXP system. I have tried b

  • Why are my images blurry when I save my doc as a pdf?

    I have Microsoft Word 2007. I am trying to save a document with a lot of images to a pdf but after I save it as a pdf...all my images are blurry? I have tried saving the images as a TIF (using Snagit) instead of a JPEG because I thought the problem w

  • [JS] Open TextFrame in "Text-Edit-Mode"...

    Hey guys, i use Javascript and InDesign CS4. And my simple question is how can i open an textframe in edit mode for the user ? Thx!