通过JavaScript将输入框设置为只读
注意:readOnly中的O要大写
//页面初始化录入,判断指标说明是否为工资性支出。
function init() {
var mark = "<%=mark%>";
//如果指标说明为“工资性支出”,则工资支出那一项变为只读,且值为“指标可用金额”;其他录入框都不可录入。
if(mark!="" && mark=="工资性支出") {
document.getElementById("money0").readOnly = "true";
document.getElementById("money1").readOnly = "true";
document.getElementById("money3").readOnly = "true";
document.getElementById("forwhat0").readOnly = "true";
document.getElementById("forwhat1").readOnly = "true";
document.getElementById("forwhat3").readOnly = "true";
document.getElementById('money2').value = <%=budgetMoney[2]%>;
document.getElementById('money2').readOnly = "true";
} else {
//如果指标说明不为“工资性支出”,则工资支出那一项不可录入。
document.getElementById('money2').readOnly = "true";
document.getElementById('forwhat2').readOnly = "true";
}
}
相关文档:
scrollHeight: 获取对象的滚动高度。
scrollLeft:设置或获取位于对象左边界和窗口中目前可见内容的最左端之间的距离
scrollTop:设置或获取位于对象最顶端和窗口中可见内容的最顶端之间的距离
scrollWidth:获取对象的滚动宽度
offsetHeight:获取对象相对于版面或由父坐标 offsetParent 属性指定的父坐标的高度
offsetL ......
document.close();
document.open();
function jsonFormat(template, json) {
return template.replace(/\$\{(.+?)\}/g, function ($, $1) {
return json[$1];
});
}
var links = [
{ text: "人肉搜索", url: "http://renrousousuo.com" } ,
{ text: "CSDN", url: &qu ......
1,用户名不能包含空格,第一个字母不能为数字,长度控制
2,密码和验证码要相同,不能为空,等等,一些很基本的功能,但是确实挺烦人的。
javascript调试起来确实比较麻烦。
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<T ......
前几天在测试网站兼容性问题,发现原来在IE下面正常的显示时间在Firefox获取年份下显示109
&nb ......
1.<select></select>标签应用
通常的写法是:
<select onchange="javascript:windwo.open(this.options[this.selectedIndex].value)">
<option>MAIN</option>
& ......