服务器间错误:php访问动态创建的元素数组
Inter Server Error : php access dynamically created element array
带有一组元素(文本框)的talbe行由Javascript动态创建,如下所示:
var newitemstr="<tr id='id_newitemrow_cnt'>"+
"<td> <input type='checkbox' id='id_item_cnt'></td>" +
"<td><input type='text' name='itemdesc[]' id='id_itemdesc_cnt' class='offerval'></td>"+
"<td><input type='text' name='itemquty[]' id='id_itemquty_cnt' class='offerval'></td>"+
"<td><input type='text' name='itemprice[]' id='id_itemprice_cnt' class='offerval'></td>"+
"<td><input type='text' name='itemother[]' id='id_itemother_cnt' class='offerval'></td>"+
"</tr>";
itemcnt = itemcnt + 1;
newitemstr = newitemstr.replace(/cnt/g, String(itemcnt));
//alert(newitemstr);
$("#id_itemtable").append(newitemstr);
提交后,我想使用php文件检索在动态创建的文本框中输入的值,如:
$itemd = $_POST['itemdesc'];
$itemq = $_POST['itemquty'];
$itemp = $_POST['itemprice'];
$itemo = $_POST['itemother'];
$itemd = $_POST['itemdesc'];
然而,我收到了"内部服务器错误",有什么原因的建议吗?thanx。
thanx有很多回复。问题是,在循环控制中,我错过了索引i之前的"$"。
相关文章:
- 在运行时创建元素时移到一边时出错
- 如何在动态创建元素的内联onclick事件中传递对象
- 在 jquery 中创建元素
- 当我动态创建元素时,选择的插件不起作用
- HTML javascript函数来创建元素
- 从外部 js 脚本创建元素并插入到 html 中
- 在 d3 中为数据列表创建元素
- 如何在循环中创建元素并将其添加到DOM中
- JQuery-创建元素并将其连接到其他html
- 创建元素更好还是只在html上准备好它们
- 挂钩文档.使用函数原型创建元素
- Javascript动态创建元素和onclick函数
- 从任何jquery选择器字符串创建元素的最有效方法
- 动态创建元素和添加onclick事件不起作用
- 在javascript中创建元素时,CSS转换规则固有地被覆盖
- 如何在特定的HTML标记下用JavaScript创建元素
- 如何根据我正在读取的节点的元素名称创建元素
- 使用Jquery在元素中创建元素
- 使用JavaScript创建元素并使用它
- 将托管 Bean 与 javascript 结合使用来创建元素