I have the following radtextbox that is set in the aspx so it is hidden on page load.
I am trying to show it on different events, one of which is on rowclick of a radgrid. I have this in my javascript code and it is not working ( i tried setting it to "" to "block" and to "inline" and it never shows.
I also try setting it in C#:
And nothing I do makes it appear on the page.
<b><telerik:RadTextBox ID="pName" runat="server" style="display:none" ></telerik:RadTextBox></b> |
I am trying to show it on different events, one of which is on rowclick of a radgrid. I have this in my javascript code and it is not working ( i tried setting it to "" to "block" and to "inline" and it never shows.
document.getElementById('pName').style.display = ''; |
I also try setting it in C#:
pName.Style.Add("display", "block"); |
And nothing I do makes it appear on the page.
6 Answers, 1 is accepted
0
Hi Laura,
RadTextBox has more complex HTML rendering than regular asp:TextBoxes and CSS styles are apllied in a different way.
Here is an example with two alternative Javascript functions, which work:
HTML
Javascript
Alternative Javascript
Kind regards,
Dimo
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
RadTextBox has more complex HTML rendering than regular asp:TextBoxes and CSS styles are apllied in a different way.
Here is an example with two alternative Javascript functions, which work:
HTML
<asp:Button ID="Button1" runat="server" Text="Toggle RadTextBox" OnClientClick="ToggleRadTextBox();return false;" /> |
<telerik:RadTextBox ID="RadTextBox1" runat="server" style="display:none" Text="RadTextBox1" /> |
Javascript
function ToggleRadTextBox() |
{ |
var tb = $find("<%= RadTextBox1.ClientID %>")._textBoxElement; |
tb.style.display = tb.style.display == "none" ? "" : "none"; |
} |
Alternative Javascript
function ToggleRadTextBox() |
{ |
var tb = $get("<%= RadTextBox1.ClientID %>_text"); |
tb.style.display = tb.style.display == "none" ? "" : "none"; |
} |
Kind regards,
Dimo
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
mzn developer
Top achievements
Rank 1
answered on 30 Jan 2009, 05:38 PM
This works to show the hidden textbox initially, but when I mouse over the textbox it disappears. Any ideas?
0
Hello,
You are right, I didn't think about this. Please refer to this forum thread, which discusses the same issue:
http://www.telerik.com/community/forums/aspnet-ajax/input/style-of-dateinput-on-the-client.aspx
Kind regards,
Dimo
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
You are right, I didn't think about this. Please refer to this forum thread, which discusses the same issue:
http://www.telerik.com/community/forums/aspnet-ajax/input/style-of-dateinput-on-the-client.aspx
Kind regards,
Dimo
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Vijay kumar
Top achievements
Rank 1
answered on 06 Nov 2012, 01:39 PM
I am also facing what mzn developer have..i followed below link what did u post on page.that didnt work for me...
please send solutions that would be great....
please send solutions that would be great....
0
Princy
Top achievements
Rank 2
answered on 07 Nov 2012, 07:25 AM
Hi,
One suggestion is that you can set the visibility of RadTextBox as follows.
C#:
Hope this helps.
Thanks,
Princy.
One suggestion is that you can set the visibility of RadTextBox as follows.
C#:
protected
void
Button1_Click(
object
sender, EventArgs e)
{
RadTextBox1.Visible = (RadTextBox1.Visible ==
false
) ?
true
:
false
;
}
Hope this helps.
Thanks,
Princy.
0
Matt
Top achievements
Rank 1
answered on 16 May 2018, 08:48 PM
Works perfect. Thanks!