1.获得焦点则输入框中文字被选中
<html:textarea property="crmCmrSuccess" value="成功经验" name="<%=Constants.CRM_MARKET_RESULT%>" rows="2" style="width:100%;"οnfοcus="if(this.value=='成功经验') this.select();" />
2.失去焦点时进行有效性验证
<html:text name="details" property="crmCedPlanfee"
οnblur="calMoney();"styleClass="input_text_none" indexed="true" />
<script language="javascript">
function calMoney(){
var feeTotal = document.forms[0].elements("crmCetTotlemoney");
var chks = document.forms[0].elements("chk");
var allmoney = 0;
var planfee ;
for(var i=0;i<chks.length;i++){
if(chks[i].checked == true){
planfee = document.all("details[" + i + "].crmCedPlanfee");
if(
isNaN(planfee.value))
planfee="0";
allmoney += parseFloat(planfee.value);
}
}
feeTotal.value = roundDecimal(allmoney,2);
}
}
</script>