c# - Cannot able to set text box value using javascript in ASP.NET -
any 1 please tell me how set value of textbox.
function morefieldseditfunction(extrafname, extrafvalue) { document.getelementbyid('<%= textbox1.clientid %>').value =extrafvalue; } <asp:textbox id="textbox1" runat="server"></asp:textbox>
it not working
i don't think million milles off honest, have taken code , put web form button can clicked call function , works, without seeing mark difficult diagnose should this:
<html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <script type="text/javascript"> function morefieldseditfunction(extrafname, extrafvalue) { document.getelementbyid('<%= textbox1.clientid %>').value = extrafvalue; } </script> </head> <body> <form id="form1" runat="server"> <input type="button" onclick="morefieldseditfunction('test', 'test2')" value="click me" /> <asp:textbox id="textbox1" runat="server"></asp:textbox> </form> </body> </html>
this should work.
Comments
Post a Comment