This is a migrated thread and some comments may be shown as answers.

Pb with input button style display none

2 Answers 68 Views
FormDecorator
This is a migrated thread and some comments may be shown as answers.
Maveric
Top achievements
Rank 2
Maveric asked on 15 Jul 2009, 10:21 AM
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 Answers, 1 is accepted

Sort by
0
Accepted
Martin
Telerik team
answered on 15 Jul 2009, 01:35 PM
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.
0
Maveric
Top achievements
Rank 2
answered on 15 Jul 2009, 02:10 PM
Hi Martin,

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

Eric
Tags
FormDecorator
Asked by
Maveric
Top achievements
Rank 2
Answers by
Martin
Telerik team
Maveric
Top achievements
Rank 2
Share this question
or