structs button状态

来源:百度知道 编辑:UC知道 时间:2024/06/28 04:41:23
在jsp里,我需要完成这样的一段程序,当a的值为Y时,显示一个button,否则不显示
<input type="SUBMIT" name="event" onclick="return delete('<%=a.geNum()%>')" value="Delete"/>
<td class="tblSubData6" align="left" width="8%">
<%if (vehicle.getClose() == 'N' ) { %>
<input type="SUBMIT" name="event" onclick="return delete()“ value="Delete"/>
<%}%>
</td>
请告诉我有什么错误

(vehicle.getClose() == 'N' )比对字串、字符应该使用 equals()吧,另外onclick事件里面 什么要使用return 啊?去掉的花也可以调用吧!~

你可以用jstl

<c:if test="${a.num==Y}">
<input type="SUBMIT" name="event" onclick="return delete('${a.num}')" value="Delete"/>
</c:if>