Hide the "Add existing" button RRS feed

  • Question

  • Hi,

    I need to hide the "Add existing" button.

    Here's the code i'm using:

    Code Snippet

    _tryhide2 = function(){
    with (document.all['new_contact_new_dineintakeawaycommentcardFrame'].contentWindow.document){
              if (readyState != 'complete') return
    // Now you are placed in the frame that contains the button you want to hide                      
    if (getElementById('_MBtoplocAssocOneToMany10001newcontactnewdineintakeawaycommentcard')!=null)

    // The id is the one that you want to hide
    with (getElementById('_MBtoplocAssocOneToMany10001newcontactnewdineintakeawaycommentcard')){
                  // nextSibling.style.display='none'; //hide the spacer as well
        } catch(e) { return setTimeout(arguments.callee,100); }




    I tried it on a VM, it worked fine. Now i'm trying it on a real server, i'm getting the following problem.

    When i click the first time on the button in the left bar to open the associated view, i can see the "Add existing" button; if i then click on anothe button from the left bar and then reclick on my button(which i need to hide the "Add existing" for) then the "Add existing" button is hidden.

    So i have to click the button on the left bar then click another then reclick it in order to see that "Add existing" is hidden.

    So how can i make it disappear from the first click?

    What could be wrong in the code?

    It's urgent!!

    Thanks in advance


    Thursday, September 4, 2008 8:11 AM


  • i found the solution.

    I should comment the following line:

    if (readyState != 'complete') return


    Thursday, September 4, 2008 9:49 AM