如何使用jquery在gridview中获取文本框的文本框ID和值 [英] How to get textbox id and value of textbox inside gridview using jquery

查看:60
本文介绍了如何使用jquery在gridview中获取文本框的文本框ID和值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我想使用jquery在keyview事件中获取Gridview内的文本框ID和值。我使用$([id * = gridId] [id * = txtboxId] ).keyup(function(){}这个代码可以获得,但它只有单个文本框(txtboxId)的id和值。我有asp.net文本框控件。我想在gridview里面的每个文本框中生成唯一的id。 />




先谢谢;-)



我有什么试过:



我使用$([id * = gridId] [id * = txtboxId])。keyup(function(){} this代码得到但其唯一的单一文本框(txtboxId)id和值

解决方案

([id * = gridId] [id * = txtboxId])。keyup (function(){}这个代码得到但它唯一的单个文本框(txtboxId)id和value.I有asp.net文本框控件。我想在gridview里面的每个文本框中生成唯一的id。





先谢谢;-)



我是什么尝试过:



我使用


([id * = gridId] [id * = txtboxId] ).keyup(function(){}此代码可以获取,但它只能恢复单个文本框的(txtboxId)id和值

您可以在网格内设置文本框的公共类,然后使用类,您可以获得文本框ID和它的值。



这里我举了一个例子。它不在网格中,但它也适用于gridview。



 <  输入    type   =  text    id   =  txtB1    class   =  commanClass    /  >  
< span class =code-keyword>< input type = text id = txtB2 class = commanClass / < span class =code-keyword>>
< 输入 type = text id = txtB3 class = commanClass / >
< 输入 类型 = text id = txtB4 class = commanClass / >





 


Hi all,
I want to get textbox id and value of that textbox inside Gridview on keyup event using jquery.I used $("[id*=gridId] [id*=txtboxId]").keyup(function(){} this code to get but its only returing single textbox's (txtboxId) id and value.I have asp.net textbox control.I want to get unique id generated in each textbox inside gridview.


Thanks in Advance ;-)

What I have tried:

I used $("[id*=gridId] [id*=txtboxId]").keyup(function(){} this code to get but its only returing single textbox's (txtboxId) id and value

解决方案

("[id*=gridId] [id*=txtboxId]").keyup(function(){} this code to get but its only returing single textbox's (txtboxId) id and value.I have asp.net textbox control.I want to get unique id generated in each textbox inside gridview.


Thanks in Advance ;-)

What I have tried:

I used


("[id*=gridId] [id*=txtboxId]").keyup(function(){} this code to get but its only returing single textbox's (txtboxId) id and value


You can set a common class for your textbox inside grid and then using class you can get text box id and it's value.

here i have just given an example. it's not in grid but it should work for gridview too.

<input type="text" id="txtB1" class="commanClass" />
<input type="text" id="txtB2" class="commanClass" />
<input type="text" id="txtB3" class="commanClass" />
<input type="text" id="txtB4" class="commanClass" />




这篇关于如何使用jquery在gridview中获取文本框的文本框ID和值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆