Using Javascript To UnCheck A Checkbox

Hi,
I have a select list with two options in. When one of them is selected I have two checkboxes that I want hiding and setting to unselected. I can hide and show them fine using *$x_HideItemRow* and *$x_ShowItemRow*, but when I hide them I want the setting as unselected.
Have tried using html_GetElement(pThat).checked = false; but when the items are displayed again they are still displayed as selected.
Can anyone show me how to uncheck a checkbox using javascript?
Cheers
Simon

Simon,
Use firebug in firefox to see what's happening. The name of your item is applied to an HTML fieldset element that contains the actual inputs of type checkbox. Each of those has a name based on the item name with "_X" on the end as in PXX_ITEM_NAME_0.
You'll need to select the one you want to check/uncheck directly by adding the underscore and the number. Also, you can use $x over html_GetElement (just shorter).
Regards,
Dan
http://danielmcghan.us
http://sourceforge.net/projects/tapigen

Similar Messages

  • Checkbox with javascript unexpectedly unchecks other checkboxs

    Hi,
    I have a checkbox called applicant_isemailaddress which has onchange javascript
    if (this.rawValue) {Page1.doYouEmail.presence = "visible";Page1.applicant_allEmailAddresses.presence = "visible";}else {Page1.doYouEmail.presence = "hidden";Page1.applicant_allEmailAddresses.presence = "hidden";};
    when checkbox applicant_isemailaddress goes to the "on" state, then two other checkboxs on the page get unchecked.
    they are called applicant_isMaleSex and applicant_isFemaleSex, I've tried changing the names to no benefit.
    removing the above javascript fixes the behaviour
    whats the trick??
    tia.
    Brian

    its possible I am a newbie.
    I put the whole page in the masterpage page1.
    moving it to page1 as a page, not a masterpage, it works well.
    thanks for comment, it did make me think further what was I doing wrong.

  • Using Javascript to disable field "Planned"

    Hi every one,
    I want to use javascript to disable "Planned" checkbox in Project Server 2013 because we want that user can not see this planned time and be confused with the Project Server's automatic changes for the planned time.
    <script type="text/javascript">
    document.getElementById("Ribbon.ContextualTabs.MyWork.Home.ShowHide.PlannedWork-Medium-checkbox").checked = false;
    </script>
    I found this code in this subject :
    http://social.technet.microsoft.com/Forums/projectserver/en-US/0beeed2d-bebc-4217-981a-41b1252c7cc2/disable-field-planned-in-timesheet?forum=projectserver2010general
    But I don't understand where to use it. If i create a custom webpart with this code, I've got a null exception when the page is loading.
    So, can you help me ? Maybe I need to use it in an other file ?

    Hi Patmol6,
    Basically, to add javascript to a PDP (or timesheet page for instance), 
    edit the page
    add the content editor webpart
    set it as hidden
    copy paste the code
    Note that you can also point from the content editor webpart to a js file embedding the javascript code
    Here are few examples (some are in PS2007, but the process is similar): 
    http://epmsource.com/tag/content-editor-webpart/
    http://badalratra.wordpress.com/2013/05/04/how-to-disable-pdp-custom-fields-using-javascript/
    http://badalratra.wordpress.com/2013/02/03/javascript-code-to-add-custom-descriptions-underneath-project-field-on-the-pdp-page/
    http://epmcorner.wordpress.com/tag/content-editor-web-part/
    Hope this helps.
    Guillaume Rouyre - MBA, MCP, MCTS

  • Changing a select list using javascript

    Hi all,
    yesterday I had a doubt using apex_item.checkbox and how to change them using javascript:
    Re: Passing a checkbox as a parameter to a javascript function
    Today, I'm facing a similar problem, but with select lists. Here it goes. I have a report with apex_items, like this:
    select
    apex_item.checkbox(1,"ID",NULL,NULL,NULL,'f01_#ROWNUM#') " ",
    apex_item.select_list_from_lov(2,"SW_STATUS",'F2010051_SET_STATUS','onChange="setItems(''f01_#ROWNUM#'',''f03_#ROWNUM@'')"','NO') sTATUS,
    apex_item.select_list_from_lov(3,"REVISIO",'F2010051_SET_REVISIO',NULL,'NO','f04_#ROWNUM#') "REVISIO"
    from Fx1_vThe javascript code is as follows:
    <script type="text/javascript">
    function setItems(cb,estat){
      elem = $x(cb);
      alert(elem.value);
      $x(cb).checked = true;
      elem2 = $x(estat);
      alert(elem2.value); 
    </script>The idea is that everytime the item g_f02 (a select list) changes, calls the JS function with two parameters: a checkbox (g_f01) and another select list (g_f03). The function should change the items to a defined values. The checkbox changes ok thanks to the help I got yesterday, but I can't work with the third item (select list g_f03). When I try to show the value, it says "undefined".
    how could I see the actual value of the select list LOV and change it to 1, for example?
    Thank you very much, any help will be appreciated!!!
    Edited by: Elena.mtc on 19-may-2011 8:11

    Hi,
    Do you have typo in query?
    Should it be
    select
    apex_item.checkbox(1,"ID",NULL,NULL,NULL,'f01_#ROWNUM#') " ",
    apex_item.select_list_from_lov(2,"SW_STATUS",'F2010051_SET_STATUS','onChange="setItems(''f01_#ROWNUM#'',''f03_#ROWNUM#'')"','NO') sTATUS,
    apex_item.select_list_from_lov(3,"REVISIO",'F2010051_SET_REVISIO',NULL,'NO','f04_#ROWNUM#') "REVISIO"
    from Fx1_vAnd JavaScript
    <script type="text/javascript">
    function setItems(cb,estat){
      elem = $x(cb);
      alert(elem.value);
      $x(cb).checked = true;
      elem2 = $x(estat);
      alert(elem2.value); 
      $s(elem2,1); // $s function is for changing item value
    </script>Regards,
    Jari

  • Check whether the checkbox in a form is checked or not using javascript

    when we click a check box (TBD) it should set the value of a field to a default value '1234'. If we uncheck the checkbox, it should set the field as Null.
    I have defined the checkbox as STATIC2:;1234 in form.
    I used the onClick event on the checkbox and called a function to update the column.
    Inside the function i am checking whether the check box is checked using
    if (document.getElementById('P4_TBD').checked=true)
    document.getElementById('P4_COL1).value='1234';
    else
    document.getElementById('P4_COL1).value=''; /* or $s("P4_COL1", "");
    it works only when check box is checked. If check box is unchecked it is not setting the field as Null.
    I checked document.getElementById('P4_TBD').checked=false instead of else clause. it is not working.
    Please help me on this issue.
    Thanks,
    Ravi

    When you are using checkboxes or option button, the ID for your button is using an index. If you create a group of 3 checkboxes with the ID = "MY_CHECKBOXES", APEX will create the following IDs for each of your options : MY_CHECKBOXES_0, MY_CHECKBOXES_1 and MY_CHECKBOXES_2. If you want to test if the first checkboxe is checked, you'll use document.getElementById('MY_CHECKBOXES_0').checked.
    I didn't test for a lone checkbox, but I expect your checkbox to be "TDB_0" not "TDB" who is the frame around your checkbox group.

  • How to uncheck a checkbox using Screen Variants?

    Hi Masters!
    Anybody knows how to uncheck a checkbox that is already checked by default?
    I'm trying to do this using screen variants. I uncheck the checkbox and save the value (I also tried filling other values there like 'a', space, etc. and it didn't work), but at runtime it always shows the checkbox checked.
    At the same transaction there is a unchecked checkbox by default witch I can check it with a screen variant, but somehow I can't do the other way around...
    Any suggestions?
    Many thanks in advance,
    José Omar

    I checked the code and found something interesting. The
    variable I'm trying to uncheck is GV_WITH_CONTACT_PERSON.
    It's declaration:
    DATA: GV_WITH_CONTACT_PERSON TYPE XFELD VALUE 'X'.
    At the initialization of the program (at the first screen module):
    PROCESS BEFORE OUTPUT.
    MODULE INITIAL_STATE.
    And inside the MODULE INITIAL_STATE there is also:
    MOVE 'X' TO GV_WITH_CONTACT_PERSON.
    So there are places in the code that the checkbox is checked.
    Now we get another problem. I don't now when the values set at a screen variant are inserted in the screen. Is it possible that the code itself is overwriting the value set with a screen variant? Or is this not possible at this point in the code?
    Many Thanks,
    José Omar

  • Use spacebar to check/uncheck a checkbox in a datagrid.

    I have a DataGrid that has checkbox in the first column. The user wants to be able to check/uncheck the checkbox when he selects a row, by mouse or up and down keys, and hits the spacebar. Currently the spacebar functions if the last thing that the use has clicked on is the Checkbox. If the user clicks in the cell where the checkbox in located(not the checkbox itself), the spacebar won't do anything.
    <mx:TabNavigator>
         <mx:VBox>
              <ms:datagrid id="lgGrid" dataProvider="{this.lData}">
                   <mx:columns>
                        <mx:Array>
                             <mx:DataGridColumn dataField="vis" id="dfID" sortable="false">
                                  <mx:itemRenderer>
                                       <mx:Component>
                                            <mx:CheckBox click="data.vis = !data.vis"  paddingLeft="4"/>
                                       </mx:Component>
                                  </mx:itemRenderer>
                              </mx:DataGridColumn>
                              <mx:DataGridColumn dataField="name"/>
                        </mx:Array>
                   </mx:columns>
              </ms:datagrid
       </mx:VBox>
    </mx:TabNavigator>

    Your TableModel has to indicate that the column is editable. Your TableModel also has to implement setValueAt() so that when the user changes the value, it updates the data.
    The table will know to use it's own boolean renderer/editor for that column because it knows what to do when a column returns a Boolean.

  • This is what I get when I try to download my college text: This document requires global security policy to be disabled.  Please go to Edit Preferences JavaScript and uncheck the "Enable global object security policy" checkbox. NOTE: In some versions

    My college text is on my college website. When I try to download it this is what I get:
    "This document requires global security policy to be disabled.
    Please go to Edit > Preferences > JavaScript and uncheck the "Enable global object security policy" checkbox. NOTE: In some versions of Adobe Reader you may need to enable JavaScript first.
    Message code: 005"
    Help

    matermax wrote:
    Please go to Edit > Preferences > JavaScript and uncheck the "Enable global object security policy" checkbox. NOTE: In some versions of Adobe Reader you may need to enable JavaScript first.
    And - did you?

  • Highlighting a checkbox using Javascript

    I have four checkboxes on my form. I would like to highlight and change the size of a checkbox when it is selected using Javascript. Any help/input is greatly appreciated.

    You can use something like this as the MouseUp event of the field:
    if (event.target.value=="Off") event.target.strokeColor = color.black; else event.target.strokeColor = color.yellow;

  • Using javascript to detect the onclick event over a datatable row

    Hi all,
    I'm working with JSF 1.2 R.I. and I would like to add some javascript to my datatable to be able to control the onclick event on a row.
    At the moment I have just added a checkbox to be able to know which row the user wants to select but I'm not satisfied with this solution.
    <h:dataTable
    value="#{person_iupopulations_Observation.customer}" var="customer"
    rowClasses="evenRow,oddRow"
    cellspacing="0">
    <h:column>
    <f:facet name="header">
    <h:outputText value="Select" />
    </f:facet>
    <h:selectBooleanCheckbox value="" onclick="getRow(this)">
    </h:selectBooleanCheckbox>
    </h:column>
    <h:column>
    <f:facet name="header">
    <h:outputText value="Name" />
    </f:facet>
    <h:outputText value="#{customer.Name}"></h:outputText>
    </h:column>
    </h:dataTable>
    What I would like to achieve is:
    When the user clicks the row (wherever, not only the checkbox) the checkbox changes to the new value depending, off course, on the user's selection.
    For this purpose I would need to add the onclick event to every row and associate it to a javascript function to update the checkbox.
    Can anybody help me please.
    I appreciate any suggestion.
    Thanks in advance!

    I am looking for answers on how to use javascript to detect the onclick event over a datatable row . I have a selectBooleanCheckBox in one of the columns in the every row in the table. On click of the checkbox in any row of the table, I want to get some values from the selected row and also verify that the rest of the checkboxes in all the other columns are unchecked. I want to do this using javascript. If any of you have answers, please repsond. Thanks.

  • Using JavaScript to remove the loading overlay?

    Is there a way to remove the loading overlay. It appears to block events.
    I want that if the slide hasn't loaded within say, 30 seconds, then present the user with a message to go to next slide or wait.
    Is this possible?
    Thanks for any help anyone can be.

    I am looking for answers on how to use javascript to detect the onclick event over a datatable row . I have a selectBooleanCheckBox in one of the columns in the every row in the table. On click of the checkbox in any row of the table, I want to get some values from the selected row and also verify that the rest of the checkboxes in all the other columns are unchecked. I want to do this using javascript. If any of you have answers, please repsond. Thanks.

  • Using Javascript to hide objects that have no "binding" tab?

    Hello,
    I'm attempting to create a form that uses checkboxes to hide a variety of fields. I've run into a problem though; it seems that only text fields have a binding tab (unless I'm missing something).  Is there a way for me to do show hides for images and text boxes? When I hold ctrl and hover over these items there is a small circle with a red line through it, which seems to express that it is impossible to manipulate them using javascript.
    For the record, I'm using javascript as seen below:
    BusinessDBAname.presence = "hidden";
    If someone had any definite answers on this I'd really appreciate it.

    Hi,
    sorry to say that, but this is a really bad form design.
    There are a couple of things you can make it better.
    1. Give unnamed subforms a suitable naming
    2. Use subforms to organise your form
    3. Don't embed fonts at all when you only use the default fonts Arial or Myriad Pro
    4. Don't select the checkbox to embed images (they will get embedded always but this method requires more space)
    5. Set option to prevent script changes in the form to automatically, otherwise the changes wont be saved
    Ok, I suggest you to create a set of subforms to represent your Section 1 - 9.
    In each subform you then add a subform for business and sole proprietor.
    Into those subforms you then put the desired fields, images etc.
    This allows you much shorter scriptings because you only have to change the presence of the surrounding subforms to show/hide an entire set of objects.
    You form design finally should look something like this.
    form1
         Maserpage
         PayeeSetupRequest
              Section1
                   Business
                        Textfield1
                        Textfield5
                   SoleProprietor
                        Textfield1
                        Textfield3
              Section2
                   Business
                        Textfield1
                        Textfield5
                   SoleProprietor
                        Textfield1
                        Textfield3
              Section3
    Hope this helps.

  • Uncheck a Checkbox when Select List Clicked

    version 4.0.2.00.06
    Hello,
    Jari helped me with a javascript function to select all options in a multi-select list when a checkbox is checked by the user.
    A bug was reported that after clicking the checkbox to select all the options in the list, if the user then clicks on a single value in the select list the checkbox is still checked.
    Would someone help me with how to uncheck the checkbox when a single value is selected in the select list after the checkbox is checked to select all of the options in the select list?
    If you need more information please let me know.
    Thanks,
    Joe

    Hi,
    Same sample as in this post
    Re: The requested URL /apex/wwv_flow.accept was not found on this server
    I did add page JavaScript
    function checkSelected(pThis,pChk,pVal){
    var self=$($x(pThis));
    var o=self.find("option");
    var s=self.find("option:selected");
    if(s.length==o.length){
      $s(pChk,pVal);
    }else{
      $s(pChk,"");
    }And to P65_EMP multiu select HTML Form Element Attributes
    onchange="checkSelected(this,'P67_SELECT_ALL','ALL')"Regards,
    Jari

  • How can i uncheck a checkbox in table component on clicking a button

    In my application I have a table component that display data from the database and a submit button outside the table component, the first column in the table component is a checkbox, How can i uncheck the checkbox in the table component when the submit button is clicked?
    Thanks in advance.

    Something like this ... I THINK it will uncheck all checkboxes in table, but I'm not positive ... you can test!
    if checkbox id is checkbox1...
    <script type="text/javascript"><![CDATA[                                         
    function disableCheckbox()
    document.getElementById('form1:checkbox1').selected = false;
    }]]></script>Put above code inside of head tag in JSP View
    NEXT...
    go to Design View and select your button and go to properties section and select onClick property and insert this javascript in dialog...
    setTimeout('disableCheckbox()', 1)Now run the project when you click the button does the checkbox become unselected?
    Anyway this is where I would start...as far as selecting just the first checkbox if there is more than 1 record...I'm not sure...but I'm curious if this works.
    Jason

  • In me21 I want to uncheck the checkbox 'info record update'.

    In me21 I want to uncheck the checkbox 'info record update'. This checkbox is checked by default. How can I uncheck it?.

    Hi,
        Goto SHD0 Tcode, give the Transaction name ME21N,
        Click on Screen Variant Tab,
        Give the
                   Screen Variant Name : ZINFO
                   Program : SAPLMEGUI
                   Screen : 1319
       Click on Create, it will take to the Tcode,
       Give any Material no, click on Expand item, ignore any errors
       In Material Data Tab, Check the Info Record check box. Click on Back
       It will show the Screen variant which u selected with its values,
       Give short text and Exit and save, Again save, it will ask for pacakage.
      Now goto Transaction variant, and look for the Standard variant used, add the created Screen variant to that standard variant. and activate.
    Next time you open that Tcode it will defaultly checked.
    Regards
    Bala Krishna

Maybe you are looking for

  • Purchase Order with Changable Condition types

    Dear gurus, I have the following requirement from our client: The Purchase order condition type must be changable after partial GR for  is done for the PO. that is the freight charges will be different for the Open quantity. How to configure this in

  • Message mapping: Passing data at the node level

    Hi, I have a question/requirement, XI Message Mapping program need to read the incoming xml and map to a diffrerent target structure. Incoming xml has a parent node called Description and it has a value "Frauen Hemd Shoes", we need to map this value

  • Can't locate registration document.

    I just ran the setup assistant on a new iMac, but wasn't able to access my wireless networkto send the registtration information.  It said that it could be send at a later date, but now I cant locate the file to send.  Does anyone know where it is lo

  • Vendor Batch Creation

    Hi Friends, I need to some Physical Inventory with Vendor. for this I need to create some new Batches with Vendor. I have tried in MSC1N and had entered vendor and vendor Batch, but while using this in MI01, system is not picking up this batch and pr

  • Package Configuration via SQL Server For a Reporting Queue

    The scenario is a reporting queue for a web application. Currently when a user queues a report it stores the parameters in a table by queue ID.  When that report is set to run the database creates a dtexec command with all the parameters. We use this