+ -
当前位置:首页 → 问答吧 → JS得到按钮传来参数得值的问题 会的都来看下 急求!!!!

JS得到按钮传来参数得值的问题 会的都来看下 急求!!!!

时间:2011-08-23

来源:互联网

<logic:iterate id="tkx" name="pecForm" property="EmptyBoxList" >
  <html:hidden name ="tkx" property="id"/>
  <html:hidden name ="tkx" property="solution_ID"/>
  <tr>
  <td class=<%=n%2==0?"tabletd1":"tabletd2"%> >  
  <input type="checkbox" name="isEdited" value="<%=String.valueOf(i++)%>" ${tkx.type==1 ? " disabled='disabled' " : "" }/>
</td>
  <td class=<%=n%2==0?"tabletd1":"tabletd2"%> nowrap ><bean:write name="tkx" property="tripid" /></td>
  <td class=<%=n%2==0?"tabletd1":"tabletd2"%> nowrap ><bean:write name="tkx" property="pudate" /></td>
  <td class=<%=n%2==0?"tabletd1":"tabletd2"%> nowrap ><bean:write name="tkx" property="dlvdate" /></td>
  <td class=<%=n%2==0?"tabletd1":"tabletd2"%> nowrap><bean:write name="tkx" property="supplier_code" /></td>
  <td class=<%=n%2==0?"tabletd1":"tabletd2"%> nowrap><bean:write name="tkx" property="suppliername" /></td>
  <td class=<%=n%2==0?"tabletd1":"tabletd2"%> nowrap><bean:write name="tkx" property="location_code" /></td>
  <td class=<%=n%2==0?"tabletd1":"tabletd2"%> nowrap><bean:write name="tkx" property="locationdesc" /></td>
  <td class=<%=n%2==0?"tabletd1":"tabletd2"%> nowrap><bean:write name="tkx" property="name" /></td>
  <td class=<%=n%2==0?"tabletd1":"tabletd2"%> nowrap><bean:write name="tkx" property="packageQty" /></td>
  <td class=<%=n%2==0?"tabletd1":"tabletd2"%> nowrap><bean:write name="tkx" property="factory_code" /></td>
  <td class=<%=n%2==0?"tabletd1":"tabletd2"%> nowrap><input type="text" name="re_qty" value="<bean:write name="tkx" property="re_qty" />" size="8" ${tkx.type==1 ? " readonly='readonly' " : "" } ></td>
  <logic:equal name= "tkx" value= "0 " property="type"> 
<td class=<%=n%2==0?"tabletd1":"tabletd2"%> nowrap>未提取</td>
  </logic:equal>
  <logic:equal name= "tkx" value= "1" property="type"> 
<td class=<%=n%2==0?"tabletd1":"tabletd2"%> nowrap>已提取</td>
  </logic:equal>
  <td class=<%=n%2==0?"tabletd1":"tabletd2"%> nowrap>
  <html:button styleClass="buttonfocuslong" property="aaa" onclick="goToAddTkx( '${tkx.solution_ID}','${tkx.stopId}' )" > 新增无计划提空箱</html:button> </td>  
  </tr>
  <%n++;%>
  </logic:iterate>

我不知道是不是我取表单的值取错了 还是传参的方式传错了。

function goToAddTkx(solution_ID,stopId)
{


alert(soluction_ID)
}

执行JS的时候左下脚有错误;

作者: cw329103272   发布时间: 2011-08-23

没人来嘛?

作者: cw329103272   发布时间: 2011-08-23

哪位大哥 帮帮小弟阿。

作者: cw329103272   发布时间: 2011-08-23

<html:button styleClass="buttonfocuslong" property="aaa" onclick="goToAddTkx( '\"${tkx.solution_ID}\"','\"${tkx.stopId}\"' )" > 新增无计划提空箱</html:button>

试试。

作者: softroad   发布时间: 2011-08-23

又是你 呵呵 你天天泡论坛阿。

作者: cw329103272   发布时间: 2011-08-23

。。 编译都是报错。

作者: cw329103272   发布时间: 2011-08-23

budong


作者: hepeng154833488   发布时间: 2011-08-23

才开始做开发 发现好多小问题 纠结阿。

作者: cw329103272   发布时间: 2011-08-23

不懂多学习 哈哈。

作者: cw329103272   发布时间: 2011-08-23

作者: cw329103272   发布时间: 2011-08-23

就是引号问题,js参数必须用引号括起来,你仔细检查下。

作者: softroad   发布时间: 2011-08-23

function 写错了吗?

作者: cw329103272   发布时间: 2011-08-23

function没错,html调用参数的时候有错。要不就运行后看看源码,肯定是引号问题了。

作者: softroad   发布时间: 2011-08-23

源码 是这样的 goToAddTkx(,) 就这样

作者: cw329103272   发布时间: 2011-08-23

热门下载

更多