我知道這個職位是舊的,但我需要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();
}