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 - Unusual behaviour when drawing lots of images onto a large canvas -

how can i manage url using .htaccess in php? -

javascript - Chart.js - setting tooltip z-index -