Pb with input button style display none

3 posts, 1 answers
  1. Maveric
    Maveric avatar
    39 posts
    Member since:
    Apr 2007

    Posted 15 Jul 2009 Link to this post

    Hi,

    I have a input type = button on a page with style display none, so I don't want to display it
    but with FormDecorator I have a little piece of button ( the right hand) whose display.
    I can't add visible=false on this button because I can't access it by javascript.
    Is there a solution ?

    Eric
  2. Answer
    Martin
    Admin
    Martin avatar
    585 posts

    Posted 15 Jul 2009 Link to this post

    Hi Maveric,

    When a button is decorated by RadFormDecorator, it is actually wrapped in a <a /> tag in order to assure two important styling aspects:

    1. Seamless :hover / :active / :focus state achieved with CSS only
    2. Support for rounded corners via the so-called "sliding doors" approach

    When you set a button to CSS display: none, actually the button remains hidden, however you see the wrapping <a /> tag. In order to hide the entire control you may use two approaches:

    1. To put  the hidden button inside a <span /> tag, and set display: none to the span, not to the button
    2. To use the following CSS, applied to the wrapping <a />:

    .rfdSkinnedButton
    {
        display: none !important;
    }


    3. To toggle the visibility of the button on the client with JavaScript properly you need to manipulate its parentNode, instead:

    $get('Button1').parentNode.style.display = 'none'; // to set the skinned button invisible

    or

    $get('Button1').parentNode.style.display = 'inline-block'; // to set the skinned button visible


    All the best,
    Martin Ivanov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Maveric
    Maveric avatar
    39 posts
    Member since:
    Apr 2007

    Posted 15 Jul 2009 Link to this post

    Hi Martin,

    Thank you very much for your answer.
    It works perfectly.

    Eric
Back to Top