我想禁用鼠标左键单击.我使用以下脚本但不起作用.
<h:form>
<a4j:commandButton value="TestButton" onclick="alert('button cliked')"/>
</h:form>
Run Code Online (Sandbox Code Playgroud)
JavaScript是:
<script type="text/javascript">
document.captureEvents(Event.MOUSEDOWN | Event.MOUSEUP | Event.CLICK);
document.onmousedown = clickIE4;
document.onmouseup = clickIE4;
document.onclick = clickIE4;
function clickIE4()
{
return false;
}
</script>
Run Code Online (Sandbox Code Playgroud)
帮我.谢谢你的努力.
我使用c:forEach标记填充了一些值.我想在我的javascript中获取这些值.
如果我单击GetCtag值按钮,那么我想从javascript中读取(c:forEach)值.
是否有其他方法可以检索c:forEach标记值
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<f:view>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript">
function getCTagValue(ctagObject)
{
alert("CFor Each Tag Object Value: " + ctagObject);
// Here i want write code for retrieve the c:forEach tag value
}
</script>
</head>
<body>
<h:form id="cTagForm" >
<c:forEach items="${cTagBean.tagList}" var="ctag">
<c:out value="${ctag.name} …Run Code Online (Sandbox Code Playgroud)