c# - How to change the value of an asp:textbox from javascript -


i have asp:textbox

<asp:textbox id="newname" runat="server" /> 

and when user clicks "cancel" button, want erase whatever in text box making value "". if input field of type text, in javascript:

document.getelementbyid('newname').value= ""; 

but can't because asp:textbox.

when asp:textbox rendered ui, yes, input field of type text. part may issue id, can set using clientidmode:

<asp:textbox id="newname" runat="server" clientidmode="static" /> 

renders to:

<input type="text" id="newname" /> 

and javascript use should work perfectly.


Comments

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -