javascript 语句怎么不执行??

zmk85 2007-10-25 12:03:56
页面如下:
<html>
<head>
<script type="text/javascript">
function del(argid){
document.userForm.id.value=argid;
document.userForm.action="/DeleteUserAction.do" ;
document.userForm.submit();
}
</script>
<title>Insert title here</title>
</head>
<body>
<center>
<table><html:errors/></table>
<table border="1" cellpadding="0" cellspacing="0">
<tr>
<td style="background-color:#808080;font-size:12pt;color:#ffffff;font-weight:bold;line-height:15pt;border:1px solid #808080;">
<bean:message key="message.user.id"/>
</td>

<td style="background-color:#808080;font-size:12pt;color:#ffffff;font-weight:bold;line-height:15pt;border:1px solid #808080;">
<bean:message key="message.user.name"/>
</td>

<td style="background-color:#808080;font-size:12pt;color:#ffffff;font-weight:bold;line-height:15pt;border:1px solid #808080;">
<bean:message key="message.user.sex"/>
</td>

<td style="background-color:#808080;font-size:12pt;color:#ffffff;font-weight:bold;line-height:15pt;border:1px solid #808080;">
<bean:message key="message.user.tel"/>
</td>

<td style="background-color:#808080;font-size:12pt;color:#ffffff;font-weight:bold;line-height:15pt;border:1px solid #808080;">
<bean:message key="message.user.address"/>
</td>
<tr>
<logic:notEmpty name="allUser">
<logic:iterate name="allUser" id="user" type="com.hello.po.User">
<tr>
<td style="word-break: break-all;">
<bean:write property="id" name="user"/>
</td>
<td style="word-break: break-all;">
<bean:write property="name" name="user"/>
</td>
<td style="word-break: break-all;">
<bean:write property="sex" name="user"/>
</td>
<td style="word-break: break-all;">
<bean:write property="tel" name="user"/>
</td>
<td style="word-break: break-all;">
<bean:write property="address" name="user"/>
</td>
<td style="word-break: break-all">
<input type="button" onclick="del('<bean:write property='id' name='userForm'/>');" value="<bean:message key="message.delete"/> ">
</td>
</tr>
</logic:iterate>
</logic:notEmpty>
</tr>
</table>
</center>
</body>
</html>
调试程序时没反应,只是提示网页有错误。
document.userForm.id.value=argid;
document.userForm.action="/DeleteUserAction.do" ;
document.userForm.submit();
userForm是定义的formBean。

初学,对中方面不太懂。希望大家多多帮助。谢谢。
...全文
222 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
微服森林 2008-03-03
  • 打赏
  • 举报
回复
2楼正解
yzk775love 2008-03-01
  • 打赏
  • 举报
回复
document.userForm.action="/DeleteUserAction.do" ; document.userForm.submit(); 把这2句可 改为一句
即:window.location="DeleteUserAction.do" 就行拉***********^^



7836
lsj91886 2008-03-01
  • 打赏
  • 举报
回复
错误代码是多少?
allen879 2008-02-29
  • 打赏
  • 举报
回复
document.userForm 有问题,整个页面根本就找不到userForm节点(表单)
ian63 2008-02-29
  • 打赏
  • 举报
回复
应该是标签的引号问题
fulianglove 2008-02-15
  • 打赏
  • 举报
回复
onclick="del(' <bean:write   property="id"   name="userForm"/> ')"   
aurora77 2007-10-26
  • 打赏
  • 举报
回复
onclick方法写的不对吧

50,530

社区成员

发帖
与我相关
我的任务
社区描述
Java相关技术讨论
javaspring bootspring cloud 技术论坛(原bbs)
社区管理员
  • Java相关社区
  • 小虚竹
  • 谙忆
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧