日期:2014-05-17  浏览次数:20645 次

HTML中的特殊属性
触发关闭当前页面脚本:
onclick="javaScript:parent.tab.close(parent.tab.present(), '');"

input 中的触发事件:onclick="getCompanyName()"

调用触发方法,弹出一个框
function getCompanyName(){

parent.u.dialog({
title: "<p:message key='businessRule.serviceItems.organMenu'/>",
width: 270,//宽度
contentHeight: 450,//窗口内包括页面的高度
height: 500,//本窗体的高度
line_count: 2,
model: true,//是否为遮障的窗口
//绑定要获取的参数
closeevent: function(){
$('#companyName').val($('#blindOrgaName',parent.u.achieve_frame()).val());
$('#companyId').val($('#blindOrgaId',parent.u.achieve_frame()).val());
},
url : "${ctx}/businessRule/serviceItems/toQueryOrgaList.htm"
});
}

隐藏值:
<input type='hidden' name='percod' id='percod'/>
<input type='hidden' name='perName' id='perName'/>

触发绑定的参数:
function chooseClick(n){
$('#percod').val(n.get('percod'));
$('#perName').val(n.get('perName'));
parent.u.close();
}

鼠标改变事件:onChange="getDeptThree();"

鼠标离开触发事件:onBlur="profitValie(profitPercentage)"
//校验自留百分比
function profitValie(profitPercentage){

var profitValue = profitPercentage.value;
var getReg = /^[0-9]+$/;

if (!getReg.test(profitValue)){
profitPercentage.value = '';
}
return true;
}



<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<script language=JavaScript>
function setVal(){
var obj = document.getElementById("yy")
alert("value:" + obj.value);
if(!obj.value){
tb.style.display = 'block'
}
else {
tb.style.display = 'none'
   }
}
</script>
</head>
<body>
<input type="text" name="yy" id="yy" onkeyup="setVal()">
<table border="1" width="100%" id="tb"name="tb">
<tr>
<input type="text" name="inputValue"/>
</tr>

</table>
</body>
</html>


<textarea rows="2" cols="50" class="ui-formTextarea-onlyBorder" style="width:412px; height:52px;vertical-align:middle; resize: none;"
      id="desci" name="desci" onKeyUp="javascript:var val = this.value;if(val.length>100){this.value=val.substring(0,100)}"></textarea>