[转]jQuery TextBox Water Mark with asp.net
本文转自:http://naspinski.net/post/jQuery-TextBox-Water-Mark-with-aspnet.aspx
I stole majority of this code from
http://www.aspcode.net/A-watermark-texbox-with-JQuery-and-aspnet.aspx
but I added a bit to make it swap css classes as well
$().ready(function() {
swapValues = [];
$(".wm").each(function(i) {
swapValues[i] = $(this).val();
$(this).focus(function() {
if ($(this).val() == swapValues[i]) {
$(this).val("").removeClass("watermark")
}
}).blur(function() {
if ($.trim($(this).val()) == "") { $(this).val(swapValues[i]).addClass("watermark") } }) })
});
To use it, make sure your TextBox has (one of) it's css classes set to "wm". If you want a seperate style to be applied add that initially as well, in my example, it swaps "watermark" in and out as a css class.
<asp:TextBox ID="txt" runat="server"
Text="this is the watermark" CssClass="wm watermark" />
[转]jQuery TextBox Water Mark with asp.net的更多相关文章
- High Water Mark 图示
+---- high water mark of newly created table | V +-------------------------------------------------- ...
- oracle:block 的 water mark问题
看了小布老师关于block里面数据存储的high water mark的实验,自己也做了一遍. SQL> create table x(i int,name varchar(20)); Tabl ...
- 高水线 High water mark(HWM)
所有的Oracle表都有一个容纳数据的上限(很像一个水库历史最高的水位),我们把这个上限称为“High water mark"或HWM.这个HWM是一个标记(专门有一个数据块来记录高水标记等 ...
- jQuery UI Autocomplete Combobox 配 ASP.NET DropDownList
0.引言 1.起因 一开始使用Autocomplete做了一个自动补全的文本框,如上图.后来因业务需要希望能在这个文本框的边上做个下拉列表按钮,一按就展开所有支持 ...
- jQuery AJAX and HttpHandlers in ASP.NET
https://www.codeproject.com/Articles/170882/jQuery-AJAX-and-HttpHandlers-in-ASP-NET Introduction In ...
- jQuery Ajax传递数组到asp.net web api参数为空
前端: var files = []; files.push({ FileName: "1.jgp", Extension: ".jgp", FileType: ...
- JQuery Form AjaxSubmit(options)在Asp.net中的应用注意事项
所需引用的JS: 在http://www.malsup.com/jquery/form/#download 下载:http://malsup.github.com/jquery.form.js 在ht ...
- [转]jQuery AJAX pagination plugin with ASP.NET Server Side
本文转自:http://do-web.com/jpaging/usage How does it work? 1. In order to implement the plugin, you need ...
- Jquery TextBox进入focus的时候 改变background-color
<!DOCTYPE html><html><head><script src="/jquery/jquery-1.11.1.min.js" ...
随机推荐
- WordCount程序及测试
Github地址:https://github.com/CG0317/WordCount PSP表: PSP2.1 PSP阶段 预估耗时 (分钟) 实际耗时 (分钟) Planning 计划 30 ...
- 启动应用程序的Activty多种方式
启动应用程序的Activity总共有三种方式,如下: 1>通过包名得到将启动应用的入口Activity,然后给intent附上相应的属性即可. 示例代码 public static void s ...
- JavaScript混淆压缩
比较好用的压缩软件,支持合并 JsCompressor-v3.0 比较好用的混淆站点:http://dean.edwards.name/packer/
- 人工智能热门图书(深度学习、TensorFlow)免费送!
欢迎访问网易云社区,了解更多网易技术产品运营经验. 这个双十一,人工智能市场火爆,从智能音箱到智能分拣机器人,人工智能已逐渐渗透到我们的生活的方方面面.网易云社区联合博文视点为大家带来人工智能热门图书 ...
- HttpRunner 探索 HttpRunner 最佳体现形式_安装篇
基于HttpRunner的一款小而美的测试工具--FasterRunner, 由于还是V1.0初版,很多功能还没来得及实现,已有功能还得拜托大家多多帮忙测试FasterRunner:https://g ...
- 与HDFS交互- By java API编程
环境(ubuntu下) jdk eclipse jar(很烦,整了很久才清楚) - 导包方法 查看:https://www.cnblogs.com/floakss/p/9739030.html ()” ...
- 手把手教你如何制作和使用lib和dll_转载
目录 静态库 什么是静态库? 怎么创建 如何使用 静态库的第一种使用方法 静态库的第二种使用方法 动态链接库 动态库是什么? 怎么创建 如何使用 隐式调用 显式调用 静态库什么是静态库?我们先来说一下 ...
- Python字典基础知识补充
1.添加键值对 #!/usr/bin/env python i1 = {'k1':'cai' , 'k2':123} print(i1) i1['k3'] = 0 i1['k4'] = "r ...
- 关于MVC模型的NSNotification用法
对于iOS开发开发者, Model View Controller 模型能帮你快速理清开发思路,最近在使用Model给Controller传递数据时候了解了关于 NSNotification的一些用法 ...
- vue.js路由学习笔记二
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title&g ...