JS 保存表单默认值 为空时自动填充默认值
var inputArray = document.getElementsByTagName("input");
var strArray = [];
for (var i = ; i < inputArray.length; i++) {
inputArray[i].index = i;
strArray.push(inputArray[i].value);
inputArray[i].onfocus = function () {
if (strArray[this.index] == inputArray[this.aa].value) {
inputArray[this.index].value = "";
}
inputArray[this.aa].className = "current";
};
inputArray[i].onblur = function () {
if (inputArray[this.index].value == "") {
inputArray[this.index].value = strArray[this.aa]
}
inputArray[this.index].className = "";
};
}
JS 保存表单默认值 为空时自动填充默认值的更多相关文章
- jquery 失去焦点时输入框为空时自动填写默认内容
$("#address").focus(function () { // 地址框获得鼠标焦点 var txt_value = $(this).val(); // 得到当前文本框的值 ...
- mybatis plus 增删改自动填充字段值
说明 本文实现以下需求效果 创建数据时自动填充 createUserId 和 createTime 更新数据时自动填充 updateUserId 和 updateTime(每次修改都自动填充新的 up ...
- jquery.form.js 让表单提交更优雅
jquery.form.js 让表单提交更优雅.可以页面不刷新提交表单,比jQuery的ajax提交要功能强大. 1.引入 <script src="/src/jquery-1.9.1 ...
- Vue.js:表单
ylbtech-Vue.js:表单 1.返回顶部 1. Vue.js 表单 这节我们为大家介绍 Vue.js 表单上的应用. 你可以用 v-model 指令在表单控件元素上创建双向数据绑定. v-mo ...
- ★★★【卡法 常用js库】: js汇合 表单验证 cookie设置 日期格式 电话手机号码 email 整数 小数 金额 检查参数长度
[卡法 常用js库]: js汇合 表单验证 cookie设置 日期格式 电话手机号码 email 整数 小数 金额 检查参数长度 // +---------------------- ...
- js验证表单大全
js验证表单大全 1. 长度限制 <script> function test() { if(document.a.b.value.length>50) { alert(" ...
- web自己主动保存表单
note:当中部分源代码来源网络 所用的框架:jquery 实现的功能: 1.自己主动保存表单 2.页面刷新的时候把自己主动保存的值赋值给表单元素 思路: 1.表单值改变的时候自己主动触发函数.保存表 ...
- JS 更改表单的提交时间和Input file的样式
JS转换时间 function renderTime(data) { var da = eval('new ' + data.replace('/', '', 'g').replace('/', '' ...
- Ext.js form 表单提交问题
var form = new Ext.form.FormPanel({ labelAlign : 'right', border : false, bodyStyle : 'background-co ...
随机推荐
- 获取IP和mac地址
1.获取IP static string GetLocalIp() { string hostname = Dns.GetHostName();//得到本机名 //IPHostEntry localh ...
- 设计和开发ETL系统(二)——启动
在针对某个维度模型开始ETL系统设计之前,应当完成逻辑设计,草拟高层架构计划,并且为所有的数据元素拟定源到目标映射. ETL的设计过程十分重要: 收集所有的相关信息,包括事物处理系统中所允许的提取处理 ...
- websocket 初步使用经验(python)
想实现网页前端和后端的数据同步交互,就有必要使用 websocket 的方式进行通信. python websocket github 地址:git@github.com:Aplexchenfl/py ...
- [DNS]部署局域网DNS服务器
This is a step by step tutorial on how to install and configure DNS server for your LAN using bind9. ...
- javascript获取URL参数和参数值
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
- Android Studion的Monitor中显示No Debuggable Application的解决方法
在使用Android Studion的时候,突然android Monitor中无法下拉显示调试项目,只是一直提示No Debuggable Application,然后上网搜索的解决办法: 第一种方 ...
- R中利用apply、tapply、lapply、sapply、mapply、table等函数进行分组统计
apply函数(对一个数组按行或者按列进行计算): 使用格式为: apply(X, MARGIN, FUN, ...) 其中X为一个数组:MARGIN为一个向量(表示要将函数FUN应用到X的行还是列) ...
- Oracle 10g通过创建物化视图实现不同数据库间表级别的数据同步
摘自:http://blog.csdn.net/javaee_sunny/article/details/53439980 目录(?)[-] Oracle 10g 物化视图语法如下 实例演示 主要步骤 ...
- e665. 在图像中过滤三元色
This example demonstrates how to create a filter that can modify any of the RGB pixel values in an i ...
- unicode and utf-8
今晚听同事分享提到这个,简单总结下. Unicode字符集 Unicode的出现是因为ASCII等其他编码码不够用了,比如ASCII是英语为母语的人发明的,只要一个字节8位就能够表示26个英文字母了, ...