javaScript
共 7 篇文章
JS实现复选框 全选/全不选 切换
JS实现复选框 全选/全不选 切换 from: http://shaobo.iteye.com/ <input type=checkbox name=mm value=a onclick="checkItem(this, 'mmAll')"><br> <input type=checkbox name=mm value=b onclick="checkItem(this, 'mmAll')"><br> <input type=checkbox name=mm value=c onclick="checkItem(this, 'mmAll')"><br> <input type=checkbo…
2009-03-29 10:04 · javaScript
一个比较好用的JS效验
一个比较好用的JS效验 /** 数据校验的javascript函数 By 最后一支烟 */ //消除输入字符串前后的半角和全角空格 function Trim(str){ str=str.replace(/(^ )|( $)/g, ""); return str; } //去左空格,只能去除半角 function ltrim(s){ return s.replace( /^\s*/, ""); } //去右空格,只能去除半角 function rtrim(s){ return s.replace( /\s*$/, ""); } //去左右空格,只能去除半角 function trim(s){…
2009-03-29 09:36 · javaScript
常用js验证
//字符长短 用户名 function check_name() { var upname= document.getElementById("txt_name").value; var re =new RegExp("^.{5,50}$"); var arr; if((arr = re.exec(upname)) == null) { document.getElementById("err_name").className = "style5"; document.getElementById("txt_name").value = ""; return; } document.getE…
2008-12-03 22:13 · javaScript
javascript做日期选择器实例
1.新建selectDateAll.js var months = new Array("一月", "二月", "三月","四月", "五月", "六月", "七月", "八月", "九月","十月", "十一月", "十二月"); var daysInMonth = new Array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31); var days = new Array("星期日","星期一", "星期二", "星期三", "星期四", "星期五", "星期六"); var getObject,oldObject;//取得当前对象 //…
2008-12-03 22:10 · javaScript