这是Labelify:http://www.kryogenix.org/code/browser/labelify/
基本上,它允许我将一个浅灰文本放入我的文本框中,当它们被选中时就消失了。
我只有两个问题:
谢谢!
发布于 2011-03-12 07:03:22
使用http://www.electrictoolbox.com/jquery-toggle-between-password-text-field/提供的指南,而不是Labelify。它也支持密码字段。不知道日期时间字段。
更新:看看下面的链接。你有很多选择:
http://plugins.jquery.com/project/inlineFieldLabel
发布于 2013-03-13 17:02:33
我意识到这个帖子是旧的,但是我需要Labelify做密码字段,就像您提到的那样,所以我在if (!lookupval) { return; }代码部分之后添加了这段代码,应该在第51行。
// Crob -- I added this to add the ability for Labilify to handle password fields.
// This creates a separate text field that just shows the value of title from the password field
// When focus is placed on the field it is hidden and the real field is shown. When focus is lost
// off the real field the text field is shown if there wasn't anything typed into the real field.
if ($(this).attr("type") === "password")
{
var newField = $('<input>').attr('type', 'text').attr('value', lookup(this).replace(/\n/g, ''))
.addClass("ui-input-text ui-body-c")
.data('passwordField', $(this).attr('id'))
.attr('id', 'PassHelper-' + $(this).attr('id'))
.focus(function () { $("#" + $(this).data('passwordField')).show().focus(); $(this).hide(); });
$(this).blur(function ()
{
if ($(this).val() == "")
{ $(this).hide(); $('#PassHelper-' + $(this).attr('id')).show(); }
});
$(this).after(newField);
$(this).hide();
}https://stackoverflow.com/questions/5281108
复制相似问题