dom - Javascript state for saved values in fields? -
i'm using javascript library move field labels field itself. when user starts typing in field, fade out. however, when user has saved username/password in fields, library isn't smart enough not put labels in fields, text of label overrun username or obfuscated password.
is there state of pre-populated fields query javascript selectively disable moving labels fields?
edit library i'm using: in-field labels jquery plugin
i see there has been vote close question because unclear. let me try more clear. when page loads, there saved username , password in username , password fields. wondering if there property on these fields tell me if populated saved values when page finishes loading. if unclear please ask clarifying question.
the reason want know because using javascript library puts field's label visually within field, [username____]
instead of username [________]
. problem when browser has saved username, text "username" in field runs on saved username in field. want stop moving of field label field only if there value in it. looking way can tell if field pre-populated.
i think talking placeholder attribute :
a hint user of can entered in control . placeholder text must not contain carriage returns or line-feeds. attribute applies when value of type attribute text, search, tel, url or email; otherwise ignored.
see jsfiddle :
<input type="text" placeholder="label"/>
for cross browser compatibility, see plugin : https://github.com/mathiasbynens/jquery-placeholder
Comments
Post a Comment