如何让action先执行 再执行onClickfunction printOn(){
var buttonYwlsh = document.getElementById('print');
var ywlsh = document.getElementById('ywlsh').value;
alert(ywlsh);
if(ywlsh!=null||ywlsh!="")
button.disabled = false;
}<tr align="center">
<td class="bodyFont" align="right"></td>
<td>
<t:commandButton id="save" value="过户确认" action="#{guohuBean.save}"
onclick="printOn()"
styleClass="button" style="top:10px position: relative; width: 99px" />
</td>
<td align="center" style="width: 123px;">
<input type="button" id="print" name="print" style="width: 120"
onclick="printGhd()" value="打印过户单" disabled="disabled" class="button">
</td>
</tr>
var buttonYwlsh = document.getElementById('print');
var ywlsh = document.getElementById('ywlsh').value;
alert(ywlsh);
if(ywlsh!=null||ywlsh!="")
button.disabled = false;
}<tr align="center">
<td class="bodyFont" align="right"></td>
<td>
<t:commandButton id="save" value="过户确认" action="#{guohuBean.save}"
onclick="printOn()"
styleClass="button" style="top:10px position: relative; width: 99px" />
</td>
<td align="center" style="width: 123px;">
<input type="button" id="print" name="print" style="width: 120"
onclick="printGhd()" value="打印过户单" disabled="disabled" class="button">
</td>
</tr>
var buttonYwlsh = document.getElementById('print');
var ywlsh = document.getElementById('ywlsh').value;
alert(ywlsh);
if(ywlsh!=null||ywlsh!="")
button.disabled = false;
}
]<tr align="center">
<td class="bodyFont" align="right"></td>
<td>
<t:commandButton id="save" value="过户确认" action="#{guohuBean.save}"
onclick="printOn()"
styleClass="button" style="top:10px position: relative; width: 99px" />
</td>
<td align="center" style="width: 123px;">
<input type="button" id="print" name="print" style="width: 120"
onclick="printGhd()" value="打印过户单" disabled="disabled" class="button">
</td>
</tr>
简单的说,就是 先执行action 执行成功后 ywlsh就会有值 然后我判断这个有值 打印按钮就可以启用
看到的帮下忙呀 急
h:commandButton
换为
a:commandButtononclick
换为
oncomplete? 我想问一下 这个a 是
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t" %>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
我没有这个a 标签 这个怎么写 有的 发出来一下