JS 控制超链接 双击 问题。
var dbNumForVehicle=0;
function clkForVehicle(cnum)
{
dbNumForVehicle=cnum;
if(dbNumForVehicle==1){
window.location.href='<portlet:actionURL>
<portlet:param name="cmd" value="rmVehicle"/>
<portlet:param name="vehicleId">
<jsp:attribute name="value">
${chgVehicle.vehicleId}
</jsp:attribute>
</portlet:param>
<portlet:param name="policyNumber">
<jsp:attribute name="value">
${policyNumber}
</jsp:attribute>
</portlet:param>
<portlet:param name="year">
<jsp:attribute name="value">
${chgVehicle.year}
</jsp:attribute>
</portlet:param>
<portlet:param name="make">
<jsp:attribute name="value">
${chgVehicle.make}
</jsp:attribute>
</portlet:param>
<portlet:param name="vmodel">
<jsp:attribute name="value">
${chgVehicle.model}
</jsp:attribute>
</portlet:param>
</portlet:actionURL>';
return true;
}
if(dbNumForVehicle==2){
alert("Don't double click, waiting!!!...");
return false; //do nothing.
}
}
我想在超链接里,控制它,不让它双击提交(第二次拒绝!)
<a href="#" ondblclick="return clkForVehicle(2);" onClick="return clkForVehicle(1);">