checkbox 之内容一致与只读状态
来源:互联网 发布:cms色彩管理系统下载 编辑:程序博客网 时间:2024/06/04 19:44
需求分析如下:
用户输入两组用户信息:一组是送货目的地,另一组是账单组目的地。在大多数情况下,这两个地址是一致的。让用户重复输入两次相同的信息会导致用户友好度降低,而这非
我们所想。
通过给账单地址添加复选框,意在指示账单地址是否与送货地址一致。如果选中复选框,就从送货地址复制账单地址并且设为只读状态;如果取消选中复选框,就从文本字段里
清空账单地址和只读状态。
<fieldset><legend>The Test form</legend><div><form name="testForm" action=""><div><label>First name:</label><input type="text" name="firstname" id="firstname" /></div><div><label> Last name:</label><input type="text" name="lastname" id="lastname" /></div><div id="shopingAddress"><h2>Shop address</h2><div><label> Stress address:</label><input type="text" name="shopAddress" id="shopAddress" /></div><div><label> City,state,zip:</label><input type="text" name="shopCity" id="shopCity" /><input type="text" name="shopState" id="shopState" /><input type="text" name="shopZip" id="shopZip" /></div></div><div id="billingAddress"><h2>Bill address</h2><div> <input type="checkbox" id="sameAddressControl" /></label><label for="sameAddressControl">Billing address is same as shop address.</label></div><div><label> Stress address:</label><input type="text" name="billAddress" id="billAddress" /></div><div><label> City,state,zip:</label><input type="text" name="billCity" id="billCity" /><input type="text" name="billState" id="billState" /><input type="text" name="billZip" id="billZip" /></div></div></form></div></fieldset><script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.js"></script><script type="text/javascript">(function($){$.fn.setReadonly = function(readonly){return this.filter('input:text').attr('readonly',readonly).css({'opacity':readonly ? 0.5 : 1.0});};})(jQuery);</script><script type="text/javascript">$(function(){$('#sameAddressControl').click(function(){var same = this.checked;$('#billAddress').val(same?$('#shopAddress').val():'');$('#billCity').val(same?$('#shopCity').val():'');$('#billState').val(same?$('#shopState').val():'');$('#billZip').val(same?$('#shopZip').val():'');$('#billingAddress input').setReadonly(same);});});</script>
0 0
- checkbox 之内容一致与只读状态
- checkbox 只读
- redio 只读,checkbox只读
- 保持TreeView(微软的)父子节点的CheckBox节点状态一致的一种方法
- 保持TreeView父子节点的CheckBox节点状态一致的一种方法
- Checkbox的只读设置
- checkbox的只读设置
- Oracle数据库只读与可写状态的变更
- Android之ListView的CheckBox状态错乱
- 设置checkbox为只读效果
- HTML文本框只读状态
- 关于txt文本的内容与html页面上显示的内容格式一致的问题
- 小技巧要你命三千之:checkbox radio select 只读效果
- QML之CheckBox与ComboBox
- Linux修改时间,使之与Internet时间一致(CentOS)
- for循环的判断条件与内容的list重合,导致for循环一致进行
- 脚本之 查看CDN cache平台访问的内容和正确的是否一致
- 一致与非一致代码段
- C#程序只允许运行一个实例的解决方案
- js获取当前指定的前几天的日期(如当前时间的前七天的日期)
- IIS无法生成日志的解决方法
- js代码美化、压缩、解压方法
- webview常见问题
- checkbox 之内容一致与只读状态
- 无线循环的可自动滚动播放轮播图
- 【MongoDB】MongoDB 2.6.5 版本 测试用Replset部署
- 自定义函数2
- github之创建版本库及一些简单命令
- Android操作系统11种传感器介绍
- 通达OA 小飞鱼工作流在线培训教程(六)HTML的Form表单
- fat mouse
- CenOS 下安装FTP和apache血泪史