Re:如何使用j查询获取中间层的html文本框值 [英] Re:how to get html textbox value in middle tier using j query
问题描述
全部请找到下面的代码。
这里我正在创建动态表格,对于那个表格我也在添加动态文本框。我的问题在于中间层如何获得文本框(多个文本框)值。
请帮助任何人。
函数BindTable1(){
$ .ajax({
类型:POST,
contentType:application / json; charset = utf-8,>
url:WebDesigner.aspx / BindDatatable2,
数据:{},
dataType:json,
成功:函数(数据){
for(var i = 0; i< data.d.length; i ++){
$(#tbDetails1 ).append(
+ data.d [i] .Field_text + | +'':''+ | < td>< input id =''txtDetails11+ i +''type =''text''/>
}
},
错误:函数(结果){
alert(错误);
}
});
}
Hi,
All Please find the below code.
Here i am creating dynamically table and for that table also i am adding dynamical text boxes.My problem is in middle tier how can i get the textbox(multiple textboxes) value.
Please help any one.
function BindTable1() {
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: "WebDesigner.aspx/BindDatatable2",
data: "{}",
dataType: "json",
success: function (data) {
for (var i = 0; i < data.d.length; i++) {
$("#tbDetails1").append("
" + data.d[i].Field_text + " | " + '':'' + " | <input id=''txtDetails11" + i + "'' type=''text'' /> |
}
},
error: function (result) {
alert("Error");
}
});
}
推荐答案
.ajax({
类型:POST,>
contentType:application / json; charset = utf-8,
url:WebDesigner.aspx / BindDatatable2,
data:{},
dataType: json,
成功:函数(数据){
for(var i = 0; i< data.d.length; i ++){
.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: "WebDesigner.aspx/BindDatatable2",
data: "{}",
dataType: "json",
success: function (data) {
for (var i = 0; i < data.d.length; i++) {
(#tbDetails1)。append();
+ data.d [i] .Field_text + < td>+'':''+< input id =''txtDetails11+ i +''type =''text''/>
}
},
错误:功能(结果){
alert(错误);
}
});
}
("#tbDetails1").append("");
" + data.d[i].Field_text + " " + '':'' + " <input id=''txtDetails11" + i + "'' type=''text'' />
}
},
error: function (result) {
alert("Error");
}
});
}
您好所有动态创建的控件都在Request.From Collection对象中可用。
您可以在回发中访问它们
Hi all the dynamically created controls are available in Request.From Collection object.
You can access them in postback as
for(int i=0;i<request.form.count;i++)>
{
string value = Request.Form["txtDetails"+i].ToString();
}
在你的情况下,你可以循环2次(在你的情况下附加行和列id)来获取所有您创建的文本框值。
In your case you can loop 2 times(to append row and column id in your case) to get all the textbox values you have created.
这篇关于Re:如何使用j查询获取中间层的html文本框值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!