How to disable the button???

Hi, guys.
I searched the forum, but did not find anything about disabling the button. There are examples of disabling text areas... But when i tried to implement same technics to disable a button, it did not work.
I have a page with two regions items region and buttons region. When page opens i want to check if P1_TXT_BOX in items region is empty and if yes, disable button P1_CMD_DOTHIS in buttons region. And then onBlur for P1_TXT_BOX, if it is not empty - enable the button.
Pls, help...
Thnks.
Mike

Hi,
I have always struggled with buttons and javascript in APEX because of the way it generates the buttons (as a "button" not "submit").
A way round it would be to create the buttons using html then disabling the accept button:
<input type="submit" id="P1_DOWNLOAD" value="Download" onclick="swapButtonStatus();" />
<input type="submit" id="P1_ACCEPT" value="Acc" onclick="swapButtonStatus();" />
<script>
document.getElementById('P1_ACCEPT').disabled="true";
</script>
You just need to put them in the region footer or somewhere applicable.
And use the following javascript function in the HTML Header:
function swapButtonStatus()
var downloadButton = document.getElementById('P1_DOWNLOAD');
var acceptButton = document.getElementById('P1_ACCEPT');
if(acceptButton.disabled=="")
downloadButton.disabled="";
acceptButton.disabled="true";
//you can submit the button using: then create a process that
//runs when request=Accept
doSubmit('Accept');
else if(downloadButton.disabled=="")
acceptButton.disabled="";
downloadButton.disabled="true";
//you can submit the button using: then create a process that
//runs when request=Download
doSubmit('Download');
Hope this helps
Graham.

Similar Messages

  • How to disable the button in application toolbar in report pgm

    Can anyone help with How to disable the button in application toolbar in report pgm

    Hi,
    You can use it_excluding to disable button on the tool bar.You have to find the function code for the required button and append that function code to the it_excluding .The optional IMPORTING parameter IT_EXCLUDING is an internal table. It is only needed if the caller uses the list tool standard interface but wants to deactivate interface functions which he or she does not need.You can have your defined pf-status using I_CALLBACK_PF_STATUS_SET.
    SAMPLE PROGRAM
    tables spfli.
    type-pools: slis.
    DATA W_FCODE TYPE SLIS_EXTAB-FCODE.
    data: t_spfli TYPE SPFLI OCCURS 0 WITH HEADER LINE.
    select * from spfli into table t_spfli.
    data : t_excluding TYPE SLIS_T_EXTAB .
    W_fcode = '&OUP'.
    append w_fcode to t_excluding.
    W_fcode = '&ODN'.
    append w_fcode to t_excluding.
    call function 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
    I_STRUCTURE_NAME = 'SPFLI'
    IS_LAYOUT =
    IT_FIELDCAT =
    IT_EXCLUDING = T_EXCLUDING
    tables
    t_outtab = T_SPFLI
    EXCEPTIONS
    PROGRAM_ERROR = 1
    OTHERS = 2.
    if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    http://help.sap.com/saphelp_nw2004s/helpdata/en/99/49b844d61911d2b469006094192fe3/frameset.htm
    Regards,
    Priyanka.

  • Disabling the button in a form

    Hi,
    May i know how to disabling the button in a form based on value of item in same itself. For eg: In a form an Select list item called 'Flag' which holds the values like Y and N. If Flag is N means the Button called 'Check' will be disable otherwise no need to disable the button 'Check'. It is our requirement, please help me if any one know the solution.
    Regards,
    Neel

    Hi Neel,
    You could set the conditional display of the button based on a Plsql function returning a boolean.
    Something along the lines of:
    IF :P1_ITEM = 'Some Value' THEN
    RETURN TRUE;
    ELSE
    RETURN FALSE;
    END IF;
    This will not display the button at all unless the P1_ITEM is equal to the value that you want.
    This is the simplest form that will get you going. If you want to "grey out" the button to leave it visible but disabled then you would need to investigate this a little further. I have seen some other threads that would probably help you out here but am no exert on javascript so just have a poke around.
    Hope this helps,
    Mike C

  • Disabling the Button in Ap invoice through custom pll

    Hi
    i have done one customization in ap invoices , such way that
    in supplier screen --> organization tab--> created the DFF for the supplier limit say 4000
    now in ap invoices screen, now i creating the PREPAYMENT, if the amount exceed that 4000, it will create hold, i written code for that
    now my problem is in HOLD TAB Release button is there,
    my requirement is RELEASE BUTTON SHOULD BE DISABLED until the until the amount is not rectified.
    in custom pll
    if form_name = 'APXINWKB' then
    if block_name = 'AP_HOLDS' then
    if event_name = 'WHEN-NEW-RECORD-INSTANCE' then
    l_invoice_id := name_in('INV_SUM_FOLDER.INVOICE_ID');
    l_release_hold :=xxcus.AKRUTI_PAYABLES_PKG.release_single_hold(l_invoice_id);
    if l_release_hold = 1 then
    fnd_message.set_string('Check the Advance amount enter greater than Supplier Limit or Advance amount greater than Purchase Order amount');
    fnd_message.show;
    set_item_property('APXHOLDS.AP_HOLDS_CONTROL.ACTION_BUTTON',ENABLED,PROPERTY_FALSE);
    elsif l_release_hold = 0 then
    set_item_property('APXHOLDS.AP_HOLDS_CONTROL.ACTION_BUTTON',ENABLED,PROPERTY_TRUE);
    end if;
    end if;
    end if;
    end if;
    the release button is not diabling since in the AP INVOICES forms, HOLDS is IN OBJECT GROUPS of that form the HOLD forms is APXHOLDS, how to disabled the button,
    it showing the message"'Check the Advance amount enter greater than Supplier Limit or Advance amount greater than Purchase Order amount"
    but it is not disabling the button

    are you using 11.5.10? If you are why not try the personalization features?

  • Disable the buttons for creation using PFCG roles

    Hi SAP Experts,
       How to disable the buttons for creation using PFCG roles?
    Regards,
    Jaya

    Hi,
    u have to write the code in <b>at selection-screen output</b> event
    AT SELECTION-SCREEN OUTPUT.
      LOOP AT SCREEN.
        IF  <b>P_PRINT</b> = 'X'.  " this is radiobutton
          IF screen-name = 'P_RANGE'.
            SCREEN-INPUT = 0.
          ENDIF.
          modify screen.
        ELSE.
          IF screen-name = 'S_LFDAT-LOW'.
            SCREEN-INPUT = 0.
          ENDIF.
          IF screen-name = 'S_LFDAT-HIGH'.
            SCREEN-INPUT = 0.
          ENDIF.
          IF screen-name = 'S_WERKS-LOW'.
            SCREEN-INPUT = 0.
          ENDIF.
          IF screen-name = 'S_WERKS-HIGH'.
            SCREEN-INPUT = 0.
          ENDIF.
          IF screen-name = 'P_LIFNR'.
            SCREEN-INPUT = 0.
          ENDIF.
          IF screen-name = 'S_BUKRS'.
            SCREEN-INPUT = 0.
          ENDIF.
          modify screen.
        ENDIF.
      ENDLOOP.
    Hope it helps.
    Regards,
    Sonika

  • How to disable the  'Change - Display' Button in Cluster via SM34 ?

    Hi
    I have a View Cluster maintained with a transaction wich calls  SM34 passing it the Cluster.
    I need the dialog be only in display mode, so i'm looking for a way to disable the button Change<->Display.
    Does somebody knows how can i do this ? maybe with an event, the button does not appears or well making the button does not change the display mode (does not change the field VIEW_ACTION siwtch from 'S' to 'U')
    Thanks in advanced
    Frank

    Hi Frank,
    On SAP 4.7 Version
    1). Goto SHD0
    2). Enter the transaction code as SM34
    3). ENter the transaction Variant as say ZSM34
    4). Click on the create button --> this will take you to the sm34 screen. If you want to default some value or disable something on this screen just hit enter on this screen. You will get a popup window to select and restrict.
    5). You can further go to next screen and deactivate the menu. On the popup screen you will get a button MENU FUNCTIONS.
    Hope this helps
    Cheers
    VJ

  • How to disable the cancel button in InputDialogBox?

    Can someone please tell me how to disable the cancel button in an input dialog box?
    thanks,

    Cross posted: [http://www.coderanch.com/t/487888/Swing-AWT-SWT-JFace/java/disable-cancel-button-input-dialog]

  • How to disable the inputfield using radio button dynamically in module pool

    How to disable the inputfield on the screen using radio button dynamically in module pool.
    Please suggest .
            Thanks.
    Edited by: Lavanya YH1504 on Jul 30, 2010 1:20 PM

    I got it thank you.
    LOOP AT SCREEN.
        if  screen-GROUP1 = 'LA1'.
           If RADIO1 = 'X'.
            SCREEN-INPUT = '0'.
            MODIFY SCREEN.
         ELSEIF RADIO2 = 'X'.
           screen-input = '1'.
          ENDIF.
          MODIFY SCREEN.
        ENDIF.
      ENDLOOP.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    Edited by: Lavanya YH1504 on Jul 30, 2010 1:51 PM

  • How to disable the select options button, while audio is playing in the question template in captivate 8?

    How to disable the select options button, while audio is playing in the question template in captivate 8?

    Apologies for late reply.
    I mean "On Question screens audio keeps on playing even after we have selected an option or options depending on the question type and clicked Submit. How do we stop the audio on selecting an option?"

  • How to Disable the Add & Review Button

    How to Disable the Add & Review Button
     *Updated with the correct ISF  code (the previous code, in case you saved it, was to actually  escape apostrophes.  That will be posted  seperately. 
    Note that this solution might not work in your environment - you might have to modify it based on your installation.
    Enjoy! 
    Common_disableAddAndReviewButton()
       if ( Moment == 'ordering' )
            var theForm = document.forms[0];
            var buttonCt = 0;
            for( i = 0; i &lt; theForm.elements.length; i++ )
                 if( theForm.elements[i].type == &quot;submit&quot; )
                    if ( buttonCt == 0 || buttonCt == 2 )
                        theForm.elements[i].disabled = true;
                         theForm.elements[i].style.visibility=&quot;hidden&quot;;                  
                     buttonCt++;              

    This is GREAT - I added a new Java Script and set it to "when form is loaded" and when I did some test reqs - no Add & Review button !!!!

  • How to disable the Add button of attachmentLink programatically in CO

    Hi All,
    Please let me know how to disable Add button created along with the view list link of attachmentLink item in OAF.
    I want to enable only the view list linkl and disable Add button.
    Thanks
    Pooja

    Hi Pooja,
    You can set the property insert allowed to false for the entity map related to attachment item in page definition.
    Now in your controller, you can set this to true if your condition is achieved.
    Dictionary[] entityMaps = attBean.getEntityMappings()
    entityMaps[0].remove("insertAllowed");
    entityMaps[0].put("insertAllowed", false);
    attBean.setEntityMappings(entityMaps);
    Hope it helps.
    Thanks,
    Deepak
    Edited by: Deepak Jain on Apr 6, 2010 11:01 PM
    Edited by: Deepak Jain on Apr 7, 2010 12:02 AM

  • How to disable the trackpad button function?

    My trackpad botton goes mad, it's seems like hold you mouse's left button and you can click the right button, just can't open the file, my usb mouse works great only in Snow Leopard, in Leopard I can use none of mouse or trackpad.
    I think my trackpad button has broken, I want to disable this button, but I don't know how, can you give me some advise?
    I'm using Snow leopard( 10.6.2 ) now, how to disable the trackpad button in SL?

    I'm using Snow leopard( 10.6.2 ) now, how to disable the trackpad button in SL and keep my trackpad available, I prefer using touchpad, I think I can disable the button and still use touchpad?
    I apologies for my poor english.

  • How to disable the 'Approve' button?

    Hi,
    I have 'Approve' and 'Reject' button in Notification page. I want to disable the button. I'm approving the notification from Forms(Front End'). The user should not approve from notification page. How to restrict that?
    Pl. help. Thanks in Advance.
    Kavi

    Hi,
    I have answered your duplicate post on the [WorkflowFAQ forum|http://smforum.workflowfaq.com/index.php?topic=1076.0] .
    HTH,
    Matt
    WorkflowFAQ.com - the ONLY independent resource for Oracle Workflow development
    Alpha review chapters from my book "Developing With Oracle Workflow" are available via my website http://www.workflowfaq.com
    Have you read the blog at http://www.workflowfaq.com/blog ?
    WorkflowFAQ support forum: http://forum.workflowfaq.com

  • How to disable the minimize button on the JFrame?

    Does anyone know how to disable the "Minimize" button on the JFrame (Window)?

    Why bother using a JFrame at all? Just extend JDialog, and there won't be a minimize button to worry about at all. The only drawback is that a JDialog doesn't put an icon in the taskbar, so you have to move/close other windows until you can see the JDialog window on the desktop.
    The windowMinimized stuff doesn't let you stop what the window is doing -- you just get an event telling you what happened.

  • How to disable the AET button on Web UI?

    Hi all,
    Does anyone know how to disable the AET button in the Web UI? Our customer doesnu2019t want the end users to change any configuration and the only thing left for this is hide/disable the AET functionality.
    Thank you very much in advance.
    Kind regards,
    Alvaro

    Alvaro,
    The AET should not be visible to end users, especially not in the production system.
    This should be done by authorisation.
    If you are referring to the personalization, you can disable this in the businessrole by selecting a value for the parameter PERSONALIZATION.
    If there are no values available, you can maintain them in sm30 --> PERSCV_PROFILE.
    Hope this helps.
    Regards,
    Pieter Rijlaarsdam

Maybe you are looking for

  • Macbook pro wireless won't turn on

    Ever since Yosemite (sound familiar?) I've been having wireless issues. At random times, wireless will simply stop working. Instead of showing the network name, it doesn't show anything. Turning off wireless results in wireless unable to be turned on

  • Export Flexibility of Custom Shapes & Layer Styles?

    Over the past few years I've developed a workflow for icon creation that involves purely custom shapes and layer styles. This has been fantastic from a number of points of view - Vector based workflow for easy scaling, resizing - Easy maintenance of

  • Solution Manager: documentation of Retrofitting transport requests

    Hi All I would know if anyone has implemented retrofit functionality in SAP Solution Manager? The documentation for this functionality is very poor  in sap service market place and I would improve my knoleges for a new project. Thank you for collabor

  • 10 G Replication Options

    The Oracle 10G Standard Edition does not offer Streams. What would one suggest to use for replicating data from one Database to another if we purchased 10G Standard Edition? We currently have Streams between 2 Databases on Oracle 9i Enterprise Editio

  • How do I straighten an image within an image.  Not the entire image.  Only a portion of the image.

    I have been looking online and in my Speaking Photoshop CS6 instruction book and cannot find where to straighten only part of an image.  Some of the image is straight but he middle section needs adjustment, straightening.  I can only find how to stra