[转]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" ...
随机推荐
- Android应用启动优化:一种DelayLoad的实现和原理
http://www.androidperformance.com/2015/11/18/Android-app-lunch-optimize-delay-load.html
- JAVA基础语法动手动脑实践体会
一.运行EnumTest.java程序. public class EnumTest { public static void main(String[] args) { Size s=Size.SM ...
- ubuntu - 14.04,如何操作Gnome的任务栏?
搜索到的答案: in gnome classic you must press both the Alt & Super keys at the same time while right-c ...
- python文件上传的三种方式
def upload(request): return render(request, 'upload.html') def upload_file(request): username = requ ...
- [SinGuLaRiTy] NOIP膜你赛-Day 1
[SinGuLRiTy-1022] Copyright (c) SinGuLaRITy 2017. All Rights Reserved. 对于所有题目:Time Limit:1s || Memo ...
- 一些意想不到的小bug。
一,当if的时候,很容易忘记相对的else,从而出现bug,要将背面消息考虑全面. 二,多个元素在同一行布局的时候,要考虑文字的换行还是省略号代替. 例如:左边一个文字,宽度不固定,右边一个图形,宽度 ...
- Oracle练习(2)
有如下三张表: 销售表:SALE_FACT 工号 年月 城市 客户 销售额 C00001 201601 上海 A 1000 C00001 201601 上海 B 5000 C000 ...
- P3613 睡觉困难综合征 LCT+贪心+位运算
\(\color{#0066ff}{ 题目描述 }\) 由乃这个问题越想越迷糊,已经达到了废寝忘食的地步.结果她发现--晚上睡不着了!只能把自己的一个神经元(我们可以抽象成一个树形结构)拿出来,交给D ...
- 【三支火把】--- 关于UEFI&PCD的总结介绍
1个人理解 个人理解PCD基本等同于Token,应当算是一种描述性语言,按照规定书写好PCD的配置档,在编译的过程中,会根据你的配置生成同等含义的C文档,而在C文档中对应会出现相应的define或者变 ...
- kuangbin专题十六 KMP&&扩展KMP HDU2087 剪花布条
一块花布条,里面有些图案,另有一块直接可用的小饰条,里面也有一些图案.对于给定的花布条和小饰条,计算一下能从花布条中尽可能剪出几块小饰条来呢? Input输入中含有一些数据,分别是成对出现的花布条和小 ...