Setting Checkbox value

Hi, very new to Formcalc. I have a simple question: I have two check boxes and if I set one I want to un-set the other. I know Radio buttons do this but I need to use check boxes. My code that is being thrown out is:
if (BookingMatrix.Row1.CheckBox[0]==1) then BookingMatrix.Row1.CheckBox[1]=0
I have also tried .value & .rawvalue, neither seem to work. The error I get is "syntax error near token "0"
Can anyone help, please:-)

Try this.
Using Javascript. Under change, put these for your checkboxs. Rename appropriately.
Checkbox1
if (this.rawValue == "1") {
  this.resolveNode("CheckBox1").rawValue = "0";
Checkbox2
if (this.rawValue == "1") {
  this.resolveNode("CheckBox2").rawValue = "0";

Similar Messages

  • How to Set CheckBox values in Before Headr Process

    In my Before Header process I read a database table that contains a code field that I would like to use to have my checkbox values checked if the field contains one of the values.
    Example the database file my have "LWR"
    On the form the Check box is
    L - For Loading
    W - For Waiting
    R - Relase
    P - Posted
    J - Job
    .....etc
    So when I read the record for my above example I would like L, W, and R checked.
    What is the best method to do this?
    THanks.

    Are you storing the values with their ":" separators (like 'L:W:R')?  If so, the checkbox code does the transformation logic.  In which case, there is no need to code insertion of the : when populating the checkbox.  No need to remove them before saving the values.
    Howard

  • Using an expression to set checkbox value

    Hi,
    I am working on an application that has a whole suite of javabeans where boolean fields are expressed as Y/N flags. Regardless of whether or not this is a good idea, that is how it is and I cannot change them (it came about because the beans map straight to database tables that do not accept Boolean datatypes).
    I am wanting to render these fields as checkboxes, ideally so that they can be properly bound to a backing bean, but it would suffice if I could just display the checkbox and have it only readonly (doesn't have to map back to the backing bean).
    I have tried to write a converter to handle these fields, but MyFaces doesn't like having a non-boolean binding for the field, even with the converter supplied.
    To just try and render the non-editable checkbox I would to be able to do the following:
    <h:selectBooleanCheckbox value="#{group.external == 'Y'}" />This works fine when the page is displayed, but it still tries to update the model when the form is submitted and throws the following exception:
    javax.faces.el.EvaluationException: Cannot set value for expression '#{group.external == 'Y'}' to a new value of type java.lang.Boolean
    Any ideas would be appreciated...

    I suggest it: on your JSF managed bean wrap your String value.
    String strExternal;
    public boolean isExternal () {
       boolean f =  "Y".equalsIgnoreCase(strExternal);
       return f;
    public void setExternal(boolean f) {
    this.strExternal =  (f ? "Y" : "N");
    }Internally you work with Stirng values, however MyFaces with booleans.

  • Set checkbox session state using Jquery / dynamic action

    Hello Folks,
    I'm trying a simple dynamic action to disable & set element value upon making a radio box selection.
    What I'd like is:
    a) if i chose "Vendor" as "Traditional" (default value) I would like to set the "SNAP" flag as Checked and "Status" textbox to "test for static value" (SNAP flag is not set, only works on Page load)
    b) if i chose "vendor" as "Isilon" then "SNAP" flag should be greyed out (disabled) and "Status" textbox should be disabled. (Working as Expected)
    Link to the page:
    http://apex.oracle.com/pls/apex/f?p=73069:6:0::NO:::
    Workspace: wksp_chandu
    Username: test
    Password:test
    Dynamic Action
    Identification
    Page:
    6. Check Disable radio
    *Name(Value Required)
    *Sequence(Value Required)
    When
    *Event(Value Required)
    - Select Event -
    Change
    Click
    Double Click
    Get Focus
    Key Down
    Key Press
    Key Release
    Lose Focus
    Mouse Button Press
    Mouse Button Release
    Mouse Enter
    Mouse Leave
    Mouse Move  Page Load
    Page Unload
    Resize
    Resource Load
    Scroll   Select          
    After Refresh
    Before Page Submit
    Before Refresh
    Change Order [Shuttle]
    Custom
    Show unsupported...
    *Selection Type(Value Required)
    - Select Selection Type -
    Item(s)
    Button
    Region
    DOM Object
    jQuery Selector
    *Item(s)(Value Required)
    Condition
    - No Condition -
    equal to
    not equal to
    greater than
    greater than or equal to
    less than
    less than or equal to
    is null
    is not null
    in list
    not in list
    JavaScript expression
    *Value(Value Required)
    True Actions
    The following actions will be fired when the 'When' condition is met, or when it is 'No Condition'.
    Edit
    Sequence
    Action
    Fire On Page Load
    Selection Type
    Affected Elements
    10
    Clear
    Yes
    Item(s)
    P6_SNAP
    P6_STATUS
    20
    Disable
    Yes
    Item(s)
    P6_SNAP
    P6_STATUS
    Add True Action
    False Actions
    The following actions will be fired when the 'When' condition is not met.
    Edit
    Sequence
    Action
    Fire On Page Load
    Selection Type
    Affected Elements
    10
    Enable
    Yes
    Item(s)
    P6_SNAP
    P6_STATUS
    30
    Set Value
    Yes
    Item(s)
    P6_STATUS
    40
    Execute JavaScript Code
    No
    Item(s)
    P6_SNAP
    Add False Action
    Thanks!
    Chandu

    Oops...I just got it working.. Thanks for your time. I was trying to set checkbox value via javascript code and somehow that wasn't working...Finally changed the setvalue to be based on "PL SQL expression" nvl(:P6_SNAP,1)...that seem to have worked.
    Thanks again !

  • Set default value for people picker only when user checks a checkbox (Sharepoint 2010)

    The javescript in below link works for me.
    http://social.technet.microsoft.com/Forums/sharepoint/en-US/2b130f64-3db2-484a-9a53-ccbe18d2c5de/set-default-value-for-people-picker-in-list-template-current-user?forum=sharepointgenerallegacy
    However, I'd like to set default user for people picker only when user checks a checkbox. 
    I am new to  development. Could you please help me on this requirement ?
    Thank you very much. 

    Hello,
    Use this link to to validate checkbox value, if true then set the person or group value (i.e. as posted in your link).
    http://geekswithblogs.net/haniamr/archive/2011/03/10/validate-that-a-checkbox-is-checked-using-javascript.aspx
    Hope it could help
    Hemendra:Yesterday is just a memory,Tomorrow we may never see
    Please remember to mark the replies as answers if they help and unmark them if they provide no help

  • Set xtype Checkbox Values

    Hello,
    I want to add a checkbox to a component's dialog box but would like the true/false event to store different values, e.g., "yes/no", "0/1" or "fred/tom" instead of "true/false".
    How do I do this?

    In html you never get Unchecked checkbox values Or you need to verify for null instead of tom.   Alternatively you could use radio. 
    http://dev.day.com/docs/en/cq/current/widgets-api/index.html?class=CQ.Ext.form.Radio

  • Retrieving checkbox values from JSP

    In my program I have an 'ADD' form.
    In that form I ask the question "Do you have a car?"
    with a single checkbox for reply.
    The code I use is below.
    Can anyone tell me how to set the checkbox to 'ticked' or 'unticked' in my
    main jsp by sending paramters from the ADD form's checkbox??
    ADD FORM...
    <form action='post' method='servlet/controller?task=addEmployee'>
    <input type'text' name='emplpoyee'>
    <input type='checkbox' name='car' value='true'>
    <input type='submit' name='submit' value='Add'>
    </form>
    Through a class I retrieve the values posted
    public Page doTask() {
    Employees employee = new Employees();
    employee.setName(request.getParameter("name"));
    employee.setCar(Boolean.getBoolean(request.getParameter("car")));
    try{
    String submit = request.getParameter("submit");
    if(submit.equals("Add")){
    model.addEmployee(employee);
    Page nextPage = new Page("/servlet/Controller?task=GetAllEmployeesTask");
    return nextPage;
    This class sends the parameters to my main JSP where
    this information is inserted. ('employees.jsp')
    my name is retrieved so...
    <= employees.getName()>
    how would I retrieve/set a checkbox value

    request.getParameter("car")
    the thing is that the browser will not send unchecked checkbox values. so you can only know it was checked by the presense or absense of the value.

  • How do I retain a PDF form widget's design when setting its value using Javacript in Acrobat?

    I've been experimenting with interactive PDF forms in InDesign and JS in Acrobat. I think I've encountered something that might be a bug: widget design is overriden when using Javascript to set the field's value in Acrobat. Here's what a checkbox, for example, should look like when checked:
    However performing:
    var f = this.getField("Checkbox");
    f.value = "Yes";
    in the JS Console results in the widget's appearance defaulting to acrobat's:
    I've tried every single widget property documented in Acrobat's Javascript API Reference to no avail. Initially, checking/unchecking using the mouse works fine. Once the value has been set using JS, Acrobat's default black check character is used for all subsequent toggling, including when using the mouse...
    How does InDesign export interactive PDFs with custom icons for widgets? Is there any way to enforce the use of those icons using JS in Acrobat Pro? What's the difference between selecting a checkbox or a radio button using the mouse and setting its value using JS?

    I thought it might be the case, too, but all widgets have the same properties both before and after setting the value with JS. I did this check using all documented properties in Acrobat JS Reference in an attempt to figure out what might be going on.
    By the way, I don't think Indesign necessarily uses glyphs for the checked state of widgets, although in this case a glyph is used (albeit with different stroke and fill colours for the glyph, acrobat doesn't allow setting these properties AFAIK). With Indesign CS6 it seems you can practically use any Indesign tool to design the widget's On and Off states. So I'm thinking that maybe Indesign exports these with button-like properties where there are no restrictions on appearance (I think there is an "icon" property/object for buttons or something like that). However Acrobat treats them as checkboxes, so if that is the case it is more of a hack. Is there a way to probe an object's various properties other than using JS or the properties pop-up dialog?

  • Place default checkbox value "in SESSION" on initial page load

    Oracle 11.2
    Apex 4.1
    Desire outcome: Chart renders on inital page load using default value of checkbox in query.
    I have a checkbox with a default (checked) value. It shows checked when the page renders for the first time but the value is not in the SESSION state. I use this value in a query for a chart. I do not want to use a Submit button so I have a dynamic action submitting the value for the checkbox and the chart refreshes as desired when I check and uncheck the box.
    I tried "Fire on Page Load" in the DA Execution Options, as well, but that caused a loop where the page renders and immmediately renders, and immediately renders, etc.
    Is there a declarative solution that submits the current, in this case default, values when the page is loaded? I only need and want the default values used the first time the page is accessed. This is the initial page of the application but I need the same behavior on all pages for the separate checkbox selections found there.
    May God Bless,
    Howard

    Howard (DBA in Training) wrote:
    If I remove the Default Value and add a Before Header page computation for the item with static assignment to
    a:bI get the 2 A/B checkboxes, both checked, and the value is set in session state.If you log in here, you can see it up close and personal!
    http://apex.oracle.com/pls/apex/f?p=21997:3 Login: Dever / Ima9Dever
    The Default Value colon-delimited string must contain the checkbox values, not the labels. In a static LOV the checkbox options are specified as <tt>label;value</tt> pairs. Thus in your checkbox LOV the labels are A/B, whilst the values are a/b. The values are case-sensitive.
    The Default Value should therefore be:
    a:bwhereas you've specified:
    A:BWith the checkbox item LOV Display Extra Values property set to Yes, APEX displays these extra values that are not included in the LOV definition as additional checkboxes. You can see this if you inspect the rendered checkbox elements in the HTML source:
    <input type="checkbox" id="P3_CHECKBOX_0" name="p_v01" value="a">
    <input type="checkbox" id="P3_CHECKBOX_1" name="p_v01" value="b">
    <input type="checkbox" id="P3_CHECKBOX_2" name="p_v01" value="A" checked="checked">
    <input type="checkbox" id="P3_CHECKBOX_3" name="p_v01" value="B" checked="checked">You get the a/b values defined in the LOV, plus the extra A/B values the LOV knows nothing about.
    ==== ) How do you keep it from setting/resetting these values each time the
    page is rendered?  The need is to do it only the very first time?  ( ====Put a Value of Item / Column in Expression 1 Is NULL condition on the Computation. Problem then is that the computation will be run if the user can [legitimately] deselect all of the checkboxes, either leaving you back where you started, or requiring the use of a further item to flag whether it is the really "the very first time" (which I find intellectually deeply unsatisfactory). This may be a sign that the control should really be a radio group that always has one option set, rather than a check box.

  • ITS templates - checkbox value not updated

    Hi,
    I am experiencing a problem with checkboxes in my Internet Service (similar to problem described in forum: checkboxes in ITS (again) ).
    The checkboxes are inside a table (step-loop) and is blank by default. If the user selects the checkbox, the value is cleared after user input.
    I executed the dialog program and it is fine.
    The generated service template was modified to accommodate the step-loop. I'm using the SAP_TEMPLATE tags for the WEBGUI look & feel.
    To set the checkbox parameter according to the user's input, should an if-statement be inserted in the code or should I use the parameter "onclick" with a javascript function?
    I inserted an if-statement but it doesn't work.
    Here's my code:
    `SAP_TemplateTableBegin(title="Some title:", type="SAP_WEBGUI")`
    `if ( IT_BEHAV-DESCR.dim > 0 )`
    `repeat with j from 1 to IT_BEHAV-DESCR.dim`
      `SAP_TemplateTableRowBegin(isSelectable="X")`
       `SAP_TemplateTableCellBegin(subtype="NONEDIT1")`   `IT_BEHAV-DESCR[j]` `SAP_TemplateTableCellEnd()`
    <b>   `if (IT_BEHAV-SELECT[j].selected)` checked `end`
       `SAP_TemplateTableCellBegin(subtype="NONEDIT1")` `SAP_TemplateSimpleCheckBox("IT_BEHAVE-SELECT", VALUE="`j`")` </b>           
        `SAP_TemplateTableCellEnd()`
              `SAP_TemplateTableRowEnd()`
             `end`
           `end`
         `SAP_TemplateTableEnd()`
    If the check on the value of the checkbox is performed within SAP_TemplateSimpleCheckbox tag (e.g. <b>`SAP_TemplateTableCellBegin(subtype="NONEDIT1")` `SAP_TemplateSimpleCheckBox("IT_BEHAVE-SELECT", VALUE="`j`", "`if (IT_BEHAV-SELECT[j].selected)` checked `end`"
    )`</b>  ),
    the checkbox values are still not updated.
    My Business HTML and Javascript is not very good, please help.
    Your assistance will be much appreciated.
    Regards
    Liza-Marie

    Hi,
    I tried
    `if (IT_BEHAV-SELECT[j]=='X')`checked`end`
    but it is still not working. I am not sure <i>where</i> it should be inserted...? I added it inside the checkbox tag as follows:
    <b>`SAP_TemplateTableCellBegin(subtype="NONEDIT1")` `SAP_TemplateSimpleCheckBox("IT_BEHAVE-SELECT", VALUE="`j`", "`if(IT_BEHAV-SELECT[j].selected)` checked `end`")`</b>
    as well as before and after this tag, without results.
    The tag SAP_TemplateSimpleCheckbox has the parameter <i>onclick</i>. I suppose this can be used to call a javascript function to control the checkbox values. I'm currently investigating this option, not that my javascript is any good!
    If the input fields of length 1 is used inside the loop, would it still work like a checkbox? I mean, can the user input any character? Do you perhaps have example code for this?
    Unfortunately I cannot debug on the ITS at this stage since I dont have access to the ITS server and it would take too long to get access or arrange for debugging to be set up.
    Thanks for the help so far!
    Regards
    Liza-Marie

  • VSC 4.2.1 on vSphere 5.5 U2 fails to 'Set Recommended Values'

    I have three ESXi 5.5 U2 hosts and each time I click on 'Set Recommended Values' I get the following:
    "You have selected one or more hosts that the Monitoring and Host Configuration is unable to set the recommended values for."
    Can you guys think of a reason?
    Picture attached.

    From memory, VSC service account didn't have propagated permissions at the root of vCenter hierarchy. I was added ok but the checkbox to propagate perms down wasn’t ticked. Give it a go and see what happens

  • Need to add row and set attribute value on pageload

    Guys,
    On my page based on the pageflowscope variable value, i need to add a row for master and one row for detail viewobject and set attribute values. (Some of the attribute are LOV and Checkboxes as well)
    I am using following code to create records.....records are being added but i am not able to set the attributes
    OperationBinding ob;
    ob = ADFUtil.findOperationBinding("Create");
    ob.execute();
    ob = ADFUtil.findOperationBinding("CreateInsert3");
    ob.execute();
    I am using following code to set the attributes value
    DCIteratorBinding dc1 = ADFUtil.getBindingIterator("firstiterator");
    DCIteratorBinding dc = ADFUtil.getBindingIterator("seconditerator");
    row1=dc1.getCurrentRow();
    row=dc.getCurrentRow();
    row.setAttribute("activest","A");
    row1.setAttribute("type","dc14");
    Anything i am doing wrong here or any suggestion to try is greatly appreciated....

    Vinod,
    Yes commit button is there and yes its also has entry in pagedef...
    When I open the same page on edit mode and i can edit regular record and save them
    Problem is that when i open the page on new mode and try to add rows on page load..... and setting values as described above.... save button somehow doesn't work...
    seems like after i add the rows on the fly, i need to refresh the binding?
    any help is greatly appreciated....
    thank you guys

  • Set default value for a custom user profile property

    Hello,
    I have a custom user profile property of type boolean. How can I by default set the value to true? OOB the checkbox remains unchecked.
    Any help on this would be appreciated.
    Thanks,
    Neha

    Hi,
    It is not possible out of the box. You can try to create a custom user profile propery programmatically, this article can help you to get started:http://msdn.microsoft.com/en-us/library/ms519896.aspx
    Xue-Mei Chang

  • Over-riding checkbox values

    Good evening all,
    I have a small problem with a checkbox on a form. I created a form that a user can submit, the form is saved in a mySQL db and the user can print out the form. When the user selects a checkbox, the value of "X" is stored in a text field in the db, when the user prints the form I created a small div with a border and display the value in the text field - which is either "X" or blank..
    That's all working fine. But, administrators can review the form and change fields, but even when they don't change the checkboxes the "X" becomes a "Y" in the db. Clearly something in the update page is setting "Checked" to be a "Y" instead of an "X". I'm using DW CS6/ Win 7 and MySQL.
    Here's part of the input form the user would see for a checkbox
    <input name="tattoo" type="checkbox" id="tattoo" size="3" value="X"/>
    and here's how a user prints out the checkbox
    <div class="fltlft" id="tbatattoo" style="border-color:#000; border-style:solid; border-width:2px; padding:5px; width:15px; min-height:20px;">
    <?php echo $row_rsVendorApp['tattoo']; ?>
    </div>
    This is the checkbox on the update page which correctly displays as checked when I open the record for update. However if I update another field and then submit the form the "X" becomes a "Y" in the db so when I open it in the update page again it shows as unchecked since the value is no longer "X" even though I made no changes, another checkbox I had left empty I did change to checked in the update page and this also shows as a "Y" in the db.
    <input
    <?php if (!(strcmp($row_rsVendor['tattoo'],"X"))) {echo "checked=\"checked\"";} ?>
    name="tattoo" type="checkbox" value="X" />
    I should add I started with the db fields defined as text then during my testing I tried changing the text field to Boolean (not really sure what i was doing there !!) and then changed it back to text. I must be missing something obvious but after several hours I just can't see what I'm doing wrong. Thanks for any advice or direction you can offer.
    Tony

    tonybabb wrote:
    Hi Ben,
    Good to hear from you. Yes I looked at the table and the values changed from "X" to "Y".
    Tony
    On the 'update' page try for the checkbox tag:
    <?php if ($row_rsVendor['tattoo'] == "X") {echo "checked=\"checked\"";} ?>
    name="tattoo" type="checkbox" value="<?php echo $row_rsVendor['tattoo']; ?>" />
    Although I don't understand why the value would change from X to Y in the database as something in your coding would be telling it to do that. Y doesn't just get written into a database without any instructions for it to do so. Maybe you have some code somewhere that says:
    insert 'X'
    else {
    insert 'Y'
    If the above doesnt work then we would need to see the code that pulls the information from the 'update' page and inserts it into the database.

  • I want to access multiple checkbox  value(its true or false when clicked)

    dear sir
    i want to access multiple checkbox value whether its true or not from one jsp to another jsp.how i can do this. because based upon checkboxes records are deleted and added.
    when i check on checkboxes and click on delete button the records are deleted onlybased upon checks.and these request forward to another jsp.so plz tell me about this.
    for example in gmail yahoomail or other mail various checkboxes are there. and if we check them and click on delete button then all checks mail are deleted.
    i will be very thankul to u sir..
    plz tell me.in this time i m in problem of this type.

    Disabled fields and unselected checkboxes/ radio buttons/ list elements are not tranmitted when a form is submitted. So when you try to getParameter() you'll only get the selected fields or you'll get a null if the field was disabled/ not selected.
    When you use this for a set of checkboxes/ radio button, you'll only get the selected ones. If nothing was selected, you'll get null. Work on your logic with this in mind.
    People on the forum help others voluntarily, it's not their job.
    Help them help you.
    Learn how to ask questions first: http://faq.javaranch.com/java/HowToAskQuestionsOnJavaRanch
    (Yes I know it's on JavaRanch but I think it applies everywhere)
    ----------------------------------------------------------------

Maybe you are looking for

  • Using Google Maps Street View on My MacBook Pro

    Recently, I have been getting "Plug-In Missing" in the place of a video in a blog post. Also, when I try to use Street View in Google Maps I get a box that tells me I need to install Adobe Flash Player 10 or later to be able to use Street View. Shoul

  • Driver for hp 54730D?

    i'm searching for a gpib-driver for the oscilloscope hp 54720D. i'm using labview 5.0.1 and 6.i. can somebody help me.

  • Cisco Prime Infrastructure patch 2.1.1 - HA issue

    Hello, I have a problem with the Cisco Prime Infrastructure patched to version 2.1.1. I did exactly what Installation Guidelines say: http://www.cisco.com/c/en/us/td/docs/net_mgmt/prime/infrastructure/2-1-1/release/notes/cpi_rn.html – Install the Pri

  • Starting tomcat server after setting classpath for java

    Sorry if this is nothing to do with java, it is more to do with starting tomcat server. Tomcat server has been working totally fine, but when I wanted to compile a java servlet I wrote for it, I needed to run a BAT file called gojava in MS-DOS that h

  • User of an interactive global activity

    Hi Please help me with the following: How do I identify the user of an interactive global activity?