Hide Cancel Button

Last post 06-15-2009, 2:54 PM by turismosw. 2 replies.
Sort Posts: Previous Next
  •  06-14-2009, 2:49 AM 53127

    Hide Cancel Button

    I want to hide the Cancel button and make it not taking any space in the page.
     
    In a post in the forum I found this code:
     
    function CuteWebUI_AjaxUploader_OnStart()
     {
      var hidden=this;
      hidden.internalobject.cancelBtn.style.visibility="hidden";
     }
     
    It works properly hiding the Cancel button but the space on the page is still used (as by rule of visibility property).
    If I try to use the property display="none" (that is the right one to free also space used by the element in the page)
     
    function CuteWebUI_AjaxUploader_OnStart()
     {
      var hidden=this;
      hidden.internalobject.cancelBtn.style.display="none";
     }
     
    the cancel button is still visible.
     
    Any way to hide and free the space of the cancel button?
     
  •  06-14-2009, 8:34 PM 53136 in reply to 53127

    Re: Hide Cancel Button

    Hi,
     
    The uploader will set the display property again.
     
    You can use CSS to hide it:
     
    Server:
      uploader.CancelButton.CssClass="HideIt";
     
    (you can also set the css class by javascript)
     
    Client:
     
    <style>
    .HideIt
    {
        display:none!important;
    }
    </style>
     
    Regards,
    Terry
     
  •  06-15-2009, 2:54 PM 53154 in reply to 53136

    Re: Hide Cancel Button

    Hi Terry,
     
    thanks for your suggestion, but please clarify how to assign a CssClass to the Cancel Button on server side.
     
    The only way I have been able to convince the Cancel Button to use a CssClass as you suggested is to force in the client script as follows:
     
    function CuteWebUI_AjaxUploader_OnStart() {
       var hidden = this;
       hidden.internalobject.cancelBtn.className =
    "HideIt";
    }
     
    If I use the server code you suggeste in pageload the CssClass assignment is ignored at all.
     
    Thanks
    Marco
View as RSS news feed in XML