我有以下html表:
ID | a | b | c
------------------------------
1 | valuea | valueb | valuec
2 | valuea | valueb | valuec
每列都有一个值的输入框(除了id)
<input name = "1_a" value = "valuea" />
<input name = "1_b" value = "valueb" />
<input name = "1_c" value = "valuec" />
<input name = "2_a" value = "valuea" />
<input name = "2_b" value = "valueb" />
<input name = "2_c" value = "valuec" />
我将此提交到一个 asp 经典页面,该页面将使用 sql 表中的属性更新每一行。
目前,我需要将名称字符串拆分为 1"_"a 以获得正确的行(1,2)和属性(a,b,c)......有更好的方法吗?
类似于:
<input name = "2[a]" />
然后在我的 asp 经典中,我将拥有一个包含所有帖子数据的数组,如下所示:
[1] =>
"a" => "valuea"
"b" => "valueb"
"c" => "valuec"
[2] =>
"a" => "valuea"
"b" => "valueb"
"c" => "valuec"