
Christopher Bishop
Top achievements
Rank 2
Christopher Bishop
asked on 23 Nov 2008, 09:50 PM
document.getElementById('testbutton').value = "fred";
does not work on buttons?
in html
<input id="testbutton" style="text-align: left;width:74px;" type="button" value="My Test Button" />
in javascript
document.getElementById('testbutton').value = "fred";
Does not change the text on the button, remove the formdecorator and it works fine...
Any ideas?
does not work on buttons?
in html
<input id="testbutton" style="text-align: left;width:74px;" type="button" value="My Test Button" />
in javascript
document.getElementById('testbutton').value = "fred";
Does not change the text on the button, remove the formdecorator and it works fine...
Any ideas?
7 Answers, 1 is accepted
0

Christopher Bishop
Top achievements
Rank 2
answered on 23 Nov 2008, 10:12 PM
I sure hope there is a function I can call instead of this
document.getElementById(
'Skinnedtestbutton').innerHTML = '<SPAN class="radfdOuterSpan"><SPAN class="radfdInnerSpan">Hello World</span></span>';
0
Hello Christopher Bishop,
Try the following function, I believe it will work for you:
Martin Ivanov
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Try the following function, I believe it will work for you:
function
changeText(SkinnedBtnId, NewText)
{
var button = document.getElementById(SkinnedBtnId).childNodes[0];
button.childNodes[0].innerHTML = NewText;
}
Regards,
Martin Ivanov
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0

Backtell
Top achievements
Rank 1
answered on 04 Jan 2009, 04:02 AM
This doesn't seem to work for me, especially on a ASP.NET button. Do you have any other suggestions? The first childNodes returns 'undefined'.
0
Hello Backtell,
It is strange why this does not work for you. Is it possible that you send me a sample project with your particular scenario and the script that changes the text of the button so I am able to help?
All the best,
Martin Ivanov
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
It is strange why this does not work for you. Is it possible that you send me a sample project with your particular scenario and the script that changes the text of the button so I am able to help?
All the best,
Martin Ivanov
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0

Christopher Bishop
Top achievements
Rank 2
answered on 05 Jan 2009, 01:47 PM
Whats the code look like that you are calling? Sounds like it isn't working because of a ID problem.
0

Chris Castle
Top achievements
Rank 1
answered on 04 Feb 2009, 05:33 AM
I am having this problem as well. Can someone post a full example for an button that is runat="server" like below?
<
asp:Button ID="btnSave" runat="server" Text="Save" />
0
Hello Chris,
Here is now to do this:
Best wishes,
Georgi Tunev
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Here is now to do this:
<form id="form1" runat="server"> |
<asp:ScriptManager ID="ScriptManager1" runat="server" /> |
<script type="text/javascript"> |
function changeText(button) |
{ |
var decoratedbutton = "_radfd_Skinned" + button.id;//allternative: var decoratedbutton = "_radfd_Skinned" + "<%= Button1.ClientID %>"; |
$get(decoratedbutton).childNodes[0].childNodes[0].innerHTML = "Text changed"; |
} |
</script> |
<telerik:RadFormDecorator ID="RadFormDecorator1" Visible="true" DecoratedControls="all" |
runat="server" /> |
<asp:Button ID="Button1" runat="server" Text="Test Button" OnClientClick="changeText(this); return false" /> |
</form> |
Best wishes,
Georgi Tunev
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.