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

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -