Using Javascript to disable a check box

Friends,
I am stuck on what should be a simple requirement and I am hoping you can help.
I need to disable a form region checkbox if a field on the same form region has anything entered.
What I have done so far is:
1) On the item that determines whether the check box should be disabled I have added a call to my Javascript function "onChange="disableDefaultDisplay();" in the "HTML Form Element Attributes"
2) My javascript funcion is: (this is the basic version, all I am trying to do is disable the check box at this point)
function disableDefaultDisplay()
alert("Start of the function");
var defaultDisplay = document.getElementById("P13_DEFAULT_DISPLAY");
*defaultDisplay.enabled = false;*
alert("End of the function");
Using a combination of firebug and the alert messages I can see that function is called at the correct time (i.e. when the user changes and then leaves the field) and that the values of the variable, defaultDate are set but my attempts to disable the checkbox have yet to work!
When I look at the type of the checkbox (through the source of the page or firebug) I see the checkbox has the following "fieldset#P13_DEFAULT_DISPLAY.checkbox_group" Do I need to do anything different to disable this type of object?
Any help would be very much appreciated!

Hi Andy,
I was returning to this thread to update it with how I resolved it, so thanks for the detailed response.
In a nutshell, the solution I used was a loop through the field set(of which there is only one item in it) and disabling it.
Where you say:
Secondly, checkboxes are, as you have seen, wrapped within a fieldset tag. The fieldset tag has an ID of the page item name. Each checkbox within that tag has its own ID value, which will be the fieldset ID plus "_n" (where n is a sequential number starting from 0) - thus, the first checkbox will be, for example, "P1_CHECKBOX_0", the second will be "P1_CHECKBOX_1" and so on.From my searching for a solution I had expected to see something like that. But the source for the item I was trying to disable is shown below and I can't see any numbers after it.
Do you know why? Is it because it is the only item?
<fieldset id="P13_DEFAULT_DISPLAY" class="checkbox_group">
<input type="checkbox" name="p_v18" value="Y" id="P13_DEFAULT_DISPLAY" /></fieldset>
Regards
Ian
Edited by: IanC2 on Feb 8, 2009 8:07 PM
Edited by: IanC2 on Feb 8, 2009 8:08 PM

Similar Messages

  • Disabling a Check box

    In my BSP View am using two check box.
    I want to disable one check box when the other one gets checked and vice versa.
    Right now am doing with some logics and with server side events.I want to do this in the client side.
    In <b>Java script</b> how i can code this in my BSP page where the checkbox is created with the help of htmlb.
    Kindly help me in this regards.

    Hi,
    put this in your documentHead:
    <script language="javascript">
         function uncheckyes(){
          document.form_id.yes.disabled='TRUE';
          </script>
    <script language="javascript">
         function uncheckno(){
          document.form_id.no.disabled='TRUE';
          </script>
    and this in your layout (documentBody):
           <htmlb:checkboxGroup columnCount = "2"
                                         id          = "expense" >
                      <htmlb:checkbox text          = "Yes"
                                      id            = "yes"
                                      onClientClick = "javascript:uncheckno()" >
                      </htmlb:checkbox>
                      <htmlb:checkbox text          = "no"
                                      id            = "no"
                                      onClientClick = "javascript:uncheckyes()" >
                      </htmlb:checkbox>
                    </htmlb:checkboxGroup>
    grtz
    Koen

  • Preventing disabling of check box - item okay in MIGO

    Dear all,
    In the MIGO transaction - during goods receipt for subcontractor material, when the item (incoming) is checked as item okay - automatically the child material (Material sent to subcontractor) is also activated thereby to enable 543 movement.
    Unfortunately some of the users are disabling the check box (for the material sent to the subcontractor). This prevents depletion of stock from the subcontractor but inflates the stock of the incoming material.
    Is there any way - either by authorisation check to prevent users disabling the check box or other methods?
    Experts suggestion is required in this regard.
    Thanks in advance.
    Regards,
    M.M

    Hi Magesh,
    it is possible. use Badi enhancement
    MB_MIGO_BADI goto
    IF_EX_MB_MIGO_BADI~POST_DOCUMENT
    tell your abaper to put the logic like
    parent ID and subcomponent ID need to select
    if either of two is not selected
    then error message will prompt not to save the GR doc since subcomponent is unselected.
    reference field EKPO check PSTYP
    hope this help you.
    regards,
    Maia
    Edited by: Maia on Apr 18, 2008 3:07 PM

  • 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

  • Disable a check box

    Hello Experts ,
    Need help to disable a check box via Scripting .
    Appreciate your help ..
    Regards,
    Tayi

    Hi Tayi,
    You can use IapiDocumentLockManager APIs to lock/unlock a particular field.
    Let us know if this is what you are actually looking for.
    Thanks
    Devesh

  • How can I disable a check box in one screen?

    Hi,
    I need to disable a check box in the screen 1106 on the program of the transaction F110. I can do that with a user exit or what I can use to do that?
    Thanks!

    you have two options :
    user exit  , check if there is one for this transction
    i attach program below .
    field exit  :
    Within the CMOD transaction type PRFB in the transaction window.
    PRFB is the ok-code to bring up the field exits.
    You can also use Program RSMODPRF to create field exits.
    hope its help u .
    program for user exut  :
    *& Report  ZUSEREXIT                                                   *
    report zuserexit no standard page heading .
    tables : tstc, tadir, modsapt, modact, trdir, tfdir, enlfdir.
    tables : tstct.
    data : jtab like tadir occurs 0 with header line.
    data : field1(30).
    data : v_devclass like tadir-devclass.
    parameters : p_tcode like tstc-tcode obligatory.
    select single * from tstc where tcode eq p_tcode.
    if sy-subrc eq 0.
      select single * from tadir where pgmid = 'R3TR'
                                   and object = 'PROG'
                                   and obj_name = tstc-pgmna.
      move : tadir-devclass to v_devclass.
      if sy-subrc ne 0.
        select single * from trdir where name = tstc-pgmna.
        if trdir-subc eq 'F'.
          select single * from tfdir where pname = tstc-pgmna.
          select single * from enlfdir where funcname =
                                              tfdir-funcname.
          select single * from tadir where pgmid = 'R3TR'
                                    and object = 'FUGR'
                                    and obj_name eq enlfdir-area.
          move : tadir-devclass to v_devclass.
        endif.
      endif.
      select * from tadir into table jtab where pgmid = 'R3TR'
                            and object = 'SMOD'
                            and devclass = v_devclass.
      select single * from tstct where sprsl eq sy-langu and
                                       tcode eq p_tcode.
      format color col_positive intensified off.
      write:/(19) 'Transaction Code - ',
           20(20) p_tcode,
           45(50) tstct-ttext.
      skip.
      if not jtab[] is initial.
        write:/(95) sy-uline.
        format color col_heading intensified on.
        write:/1 sy-vline,
               2 'Exit Name',
              21 sy-vline ,
              22 'Description',
              95 sy-vline.
        write:/(95) sy-uline.
        loop at jtab.
          select single * from modsapt where sprsl = sy-langu and
                                             name = jtab-obj_name.
          format color col_normal intensified off.
          write:/1 sy-vline,
                 2 jtab-obj_name hotspot on,
                21 sy-vline ,
                22 modsapt-modtext,
                95 sy-vline.
        endloop.
        write:/(95) sy-uline.
        describe table jtab.
        skip.
        format color col_total intensified on.
        write:/ 'No of Exits:' , sy-tfill.
      else.
        format color col_negative intensified on.
        write:/(95) 'No User Exit exists'.
      endif.
    else.
      format color col_negative intensified on.
      write:/(95) 'Transaction Code Does Not Exist'.
    endif.
    at line-selection.
      get cursor field field1.
      check field1(4) eq 'JTAB'.
      set parameter id 'MON' field sy-lisel+1(10).
      call transaction 'SMOD' and skip first   screen.

  • Disable individual check boxes in ALV

    Hi all,
    My requirement is that I have one check box against each row. User clicks on the check box then that row is selected and on clicking the push button, bapi is called.
    If result of bapi is success, I want to disable the check box for that particular row/rows. Can you please tell me how I can achieve that? I know how to disbale all the check boxes in the list but I dont know how to disable the individual check boxes.
    Thanks and regards,
    Ridhima

    For that you need to play with the EDITABLE feature of the ALV at the field level.
    Declare a field STYLE type LVC_T_STYL as a part of your internal table. Now, for each row, append the fields of that row to the STYLE column specifying whether it has to be editable or not. You can use the attributes cl_gui_alv_grid=>mc_style_enabled and cl_gui_alv_grid=>mc_style_disabled for this.
    You can look at these threads
    https://forums.sdn.sap.com/click.jspa?searchID=524737&messageID=473177
    https://forums.sdn.sap.com/click.jspa?searchID=524737&messageID=2469829
    https://forums.sdn.sap.com/click.jspa?searchID=524737&messageID=1947071
    Regards,
    Ravi
    Note - Please mark all the helpful answers
    Message was edited by:
            Ravikumar Allampallam

  • How to disable one check box when another is checked

    Hi, I'm a first time user.
    i am trying to make text fields appar and dissapaer when check boxes are ticked. but only alow one check box to be active at one time. 
    I am making a simple form in Acrobat pro 9,
    I have two check boxes Checkbox1 & Checkbox2.
    I have two text fields Textfield1 & Textfield2
    i have added actions to checkbox1 & checkbox2 to 'hide or show' the text fields.
    Action --> on focus (checkbox1) show/hide field (textfield1) is hide
    Action --> on focus (checkbox1) show/hide field (textfield2) is show
    oposite
    Action --> on focus (checkbox2) show/hide field (textfield2) is hide
    Action --> on focus (checkbox2) show/hide field (textfield1) is show
    problem 1 - how to disable checkbox1 when checkbox 2 is ticked.
    or disable checkbox2 when checkbox1 is ticked.  
    my other problem is that this action has the same effect for ticking or unticking the checkbox.
    thanks in advance to anyone who can help.
    can you please write your answer in simple terms. Basically this is the first time i have used acrobat pro so please dont assume any knowledge at all. thansk very much .

    First, I would experiment with just check boxes and learn their properties and how they can interact.
    Have you tried using the same name for 2 check boxes and assign a different "export value" to each check box.
    Have you looked at the values a check box or boxes have when checked or un-checked?
    Have you looked at how the various actions for a field work?

  • How tdo you disable a check box

    Hi
    I'm been trying to dynamically disable (grey out) a check box using
    SET_ITEM_PROPERTY('checkbox name', ENABLED, PROPERTY_FALSE);
    This is not working and when I display the value of ENABLED using GET_ITEM_PROPERTY it shows TRUE.
    Can anyone tell me how to dynamically grey out a check box?

    Dear Friend,
    Whatever u have written is perfectly all right. Only thing can be checked is, do you have 2 items with same name if 2 different blocks. if so then provide name of block in Set_item_property statement. This technique works.
    Regards,
    Manish Trivedi
    Software Developer
    India
    [email protected]

  • Disable the check box

    Hi All,
    I have a requirement in which based on the profile option user should be able to change the value of check box.
    Name of profile option is acces_level. In this user level profile option two values are possible 'User' or 'Administrator' and there are two check boxes cb1 and cb2. I want that cb2 should be available only to the user, those have value of profile option as 'Administrator'. cb1 will be available for all.
    Thanks in advance.
    Looking forward onn this.

    I used now
    declare
    nProp varchar2(20);
    BEGIN
    nProp := fnd_profile.value('ACCESS_FOR_WISPER_PART_RESEND');
    if nProp = 'ADMINISTRATOR' then
    set_item_property('XXINFC_WISPER_PARTS_MASTER.INSPECTION_FLAG', enabled, 'property_true');
    else
    set_item_property('XXINFC_WISPER_PARTS_MASTER.INSPECTION_FLAG', enabled, 'property_false');
    end if;
    END;
    I am writing this in WHEN-NEW-FORM-INSTANCE trigger at data block level.
    Now there is only one problem. In the form I am displaying 15 values. All 15 values have there respective check boxes. Now except first check box all other check boxes are disabled. Do you have any clue why the first cbox is not disabled. There is one more thing when profile option is set with value USER (Now it should allow to update the check box) then If I change any cbox then it does not allow me to change any other check box.
    Looking forward for you reply.

  • Hiding or disabling the check boxes in Tableview  for perticular row

    Hi
       I created table view using ITAREATOR, as per my requirement i need to disable or hide the check box (which come by default) for perticular row.
       Can any body send me the code
    thanks in advance
    B.Umashankar

    Is there a hide-or-disable-checkboxes-in-a-tableView-row contest going on somewhere?
    Please check Leoiz Pas' "How to disable tableView default checkbox" and Marcel Gäbe's "TableView hide checkbox" postings earlier this week (even though there might not have been a final solution yet)!

  • Event to use for Creation of a Check box on Warehouse master Form

    Hi experts
    I have created one check box on Warehouse Master form in AfterMENUClick Event. It works fine if I open the form on Menuclick . But If I open the Warehouse master form by Link button from any document, it does not show the check box. I also want to deactive the checkbox if once it checked. So, I do some coding in Data_Load event. It also works fine If I open the form by Menu click. But if I open the form by Link button it gives error " Invalid Item Id ". 
    So I want to know which event I should use to create the check box and which Event I Should use to Deactive the Check box

    Thanks Nagy for quick reply
    I use the following code for creation of check box
    <B1Listener(BoEventTypes.et_FORM_LOAD, False, New String() {"62"})> _
            Public Overridable Sub OnAfterFormLoad(ByVal pVal As ItemEvent)
                Dim ActionSuccess As Boolean = pVal.ActionSuccess
                Dim form As Form = B1Connections.theAppl.Forms.Item(pVal.FormUID)
                'ADD YOUR ACTION CODE HERE ...
                Dim oForm As Form
                Dim oMatrix As Matrix
                Dim oItem As Item
                Dim sysItem As Item
                Dim BinCheck As CheckBox
                Dim BinLabel As StaticText
                Dim cmbBinCode As ComboBox
                oForm = B1Connections.theAppl.Forms.ActiveForm
                oForm.PaneLevel = 1
                sysItem = oForm.Items.Item("2000002010") 'Excisable check box
                oItem = oForm.Items.Add("BinChk", BoFormItemTypes.it_CHECK_BOX)
                oItem.Left = sysItem.Left
                oItem.Top = sysItem.Top + 20
                BinCheck = oItem.Specific
                BinCheck.Caption = "Bin Enabled"
                BinCheck.DataBind.SetBound(True, "OWHS", "U_BinEnabled")
            End Sub
    It gives error on sysItem = oForm.Items.Item("2000002010") line Invalid Item Id
    Plz check and tell the problem
    Regards
    Gorge

  • Can't use LOV with item type "check box" in form

    I have created a LOV that I want to use with a form application in 3.0.9. I need to be able to do multiple choices in this LOV (check box style) in the same query (only queries - users won't be able to update this field)
    When I choose Check box as the item type in the form wizard I am not able to choose the LOV. I have to use combo box, popup or radio group for the LOV choices to appear, but then the query can only query for one value in the LOV at a time.
    Is there a solution to this?

    Hi,
    This feature is not supported as of now. You cannot have multi select LOV for a form field and hence a checkbox cannot have a LOV.
    Thanks,
    Sharmila

  • Using Acrobat Standard 9  Adding Check Boxes

    Have been using AA Std 9 for some time and all of sudden I cannot use the add check boxes to forms with any accuracy.  It is not an issue with the mouse.  Have downloaded patches but still cannot add fields where they need to be.  Major impact on productivity!  Ideas?

    I do have Internet Explorer 9 and I was able to print web pages correctly following  your suggestions.
    Thanks for your help.
    Date: Sat, 12 Nov 2011 06:53:59 -0700
    From: [email protected]
    To: [email protected]
    Subject: Printing web page to pdf file using Acrobat Standard 9
        Re: Printing web page to pdf file using Acrobat Standard 9
        created by Bill@VT in Acrobat Windows - View the full discussion
    There were problems with IE9 on it's initial release and that may be what you are seeing if that is the browser (you did not indicate the browser and that may be a key). If you have a different browser you might try that one with the same pages to see if it browser related.
    By saying garbled it sounds like the fonts did not make it or you have selected "Use Local Fonts" in Acrobat. Try checking the latter first. Then check if the fonts are embedded in the PDF by checking the document properties (ctrl-D). If they are not, go back to the browser and select the press or print job options before printing and see if they get embedded and if your problem is resolved.
         Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/4021509#4021509
         To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/4021509#4021509. In the Actions box on the right, click the Stop Email Notifications link.
         Start a new discussion in Acrobat Windows by email or at Adobe Forums
      For more information about maintaining your forum email notifications please go to http://forums.adobe.com/message/2936746#2936746.

  • Use Javascript to disable fields in tabular form built by wizard

    i know this type of disable question has been asked before and i have searched the forum thoroughly but the solutions always seem to be for items i.e P1_NAME and i do not have these as my form is built by a select statement
    i have worked out the syntax (i think)
    <script language="javascript" type="text/javascript">
    function desactiverElement(item)
    var x = document.getElementById(item);
    if (x)
    x.disabled = true;
    </script>
    to disable and think it goes in the html header or a html region before footer but i cannot work out how to disable the field because i cannot work out how to reference them
    i.e get the value for 'item' in the code
    any help i would be extremely grateful for
    cheers Chris

    the CENTRE_NO field has to be unique , and when i am doing my validation check ,if the user amends the field by accident and then replaces the value it gets an error when it shouldn't
    wish it was as simple as forms just change property to update_allowed = false !!

Maybe you are looking for

  • Lightroom 5.5 will not "Edit in Photoshop CC 2014" after update

    OK, seems like something is broken with the new updates. In Lightroom I can no longer "Edit photo in Photoshop." I have the proper program designated in LR preferences. I select a photo, select Edit in Photoshop CC 2014, PS launches but the photo nev

  • Posting Program for Incoming Invoice

    Hello,          I have a requirement to develop an Inbound Interface for Incoming Vendor Invoice which needs to be posted into SAP. Is IDOC_INPUT_INVOIC_MM the Posting Function Module which is used for this Purpose? Or do I need to develop a Custom P

  • Everytime i try to download a file that i've purchesed i get a currupted file prompt? ***?

    So once upon a time I bought a song, then while it was downloading it continued to download,over and over again about 5 times, each time getting to the desired amount of MB to be completed only to restart again....then i get this error prompt saying

  • Embedding a FLV file

    Info: Apple Mac OS 10.5.1 Dreamweaver 8 Hi there, I am attempting to embed a FLV file into a HTML document (an editable region based on a template) however when embedding the video the following message comes up: Making this change would require chan

  • How to fix a blackout ipod

    My iPod 4th gen just blacked out on me and it won't turn how do I fix it