LigerUI学习笔记之二 TextBox(上)
2012-09-04 10:17
204 查看
不说了直接上代码
头部引入
html代码如下
这才是正宗的
主要的知识点:
使用ligerGetTextBoxManager获取对象
设置值:setValue(value);
获取值:getValue();
禁用按钮:setDisabled();
启用按钮:setEnabled();
单词不要错了就行了。
头部引入
<link href="../lib/ligerUI/skins/Aqua/css/ligerui-all.css" rel="stylesheet" type="text/css" /> 皮肤样式文件 放第一位 <script src="../lib/jquery/jquery-1.3.2.min.js" type="text/javascript"></script> <script src="../lib/ligerUI/js/core/base.js" type="text/javascript"></script> <script src="../lib/ligerUI/js/plugins/ligerTextBox.js" type="text/javascript"></script> 插件js
html代码如下
<body style="padding: 20px"> <input id="txt1" type="text" /> <br /> <input id="txt2" type="text" /><br /> <input type="button" id="btnSet" value="设置值" /> <input type="button" id="btnGet" value="获取值" /> <input type="button" id="Button1" value="禁用" /> <input type="button" id="Button2" value="启用" /> </body>
这才是正宗的
<script type="text/javascript"> $(function () { // $("#txt1").ligerTextBox({ nullText: '不能为空', label: 'LABEL' }); // $("#txt1").ligerTextBox({ nullText: '不能为空222', label: 'LABEL44' }); //需要设置两次才有效果 有bug $("#txt1").ligerTextBox({ nullText: 'Your Name', label: '用户名', labelWidth: 100, labelAlign: 'center' }); $("#txt2").ligerTextBox({ nullText: 'Your Name', label: '密 码', labelWidth: 100, labelAlign: 'center' }); //$("#txt2").ligerTextBox({ initValue: '不能为空' ,label:'设置初始值', labelWidth:100, labelAlign:'right'}); //设置值 $("#btnSet").bind('click', function () { $("#txt1").ligerGetTextBoxManager().setValue("My name is Tom"); } ); //获取值 $("#btnGet").bind('click', function () { var name = $("#txt1").ligerGetTextBoxManager().getValue(); if (name != "") { alert(name); } else { alert("No"); } }); //禁用 $("#Button1").bind('click', function () { $("#txt1").ligerGetTextBoxManager().setDisabled(); }); //启用 $("#Button2").bind('click', function () { $("#txt1").ligerGetTextBoxManager().setEnabled(); }); }); </script>
主要的知识点:
使用ligerGetTextBoxManager获取对象
设置值:setValue(value);
获取值:getValue();
禁用按钮:setDisabled();
启用按钮:setEnabled();
单词不要错了就行了。
相关文章推荐
- LigerUI学习笔记之二 TextBox(下)
- LigerUI学习笔记之二 Tree
- c 学习笔记之二 变量的存储类型
- 【Linux】Shell学习笔记之二——文件和目录管理(创建、删除、复制、查看)
- SQL学习笔记之二:QUOTENAME函数
- mysql5.6从零开始学学习笔记之二(数据备份)
- Linux邻居协议 学习笔记 之二 通用邻居处理函数对应的数据结构的分析
- Linux基础入门学习笔记之二
- S2Container框架学习笔记之二
- dotnet学习笔记五 - 无用资源回收之二
- 项目管理学习笔记之二.工作分解
- 设计模式C++学习笔记之二(Proxy代理模式)
- SDL学习笔记之二
- ASP.NET 学习笔记之二 建立 ASP.NET 应用程序
- Flex 学习笔记之二 :flex 开发环境搭建
- jQuery学习笔记之二——常规选择器
- 设计模式C++学习笔记之二(Proxy代理模式)
- Python基础学习笔记之二
- MFC学习笔记之二----------MFC框架程序及消息映射
- 算法学习笔记之二:从1到n的正数中1出现的次数