javascript - How to render Server control Client ID in html element -


<script type="text/javascript">  function myfunc(param1, param2, param3) { //my stuff }  </script>  <asp:textbox id="txt" runat="server"></asp:textbox> <asp:button id="btn" runat="server" onclientclick="myfunc(textboxclientid, 'secondvalue', 'thirdvalue')"> 

how can send clientid of textbox javascript function button onclientclick

try this

function myfunc(param1, param2, param3) { var id = document.getelementbyid("ctrlname").value; } 

and can use

 var txtusernameid = '<%= txtboxname.clientid %>'; 

hope you

updated answer

you have try this

<input type="text" id="txtfirstname" runat="server" class="textreg" onclientclick="javascript:myfunc(<%=txtfirstname%>,'imgfirstnames','imgfirstnamee');" />` 

java script function

function myfunc(control, success, error) { control = document.getelementbyid('<%='+control+'.clientid %>'); }  

hope proper solution


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -