ciprian
ciprian

Reputation: 443

Jquery - Sliding up form labels problem

I am not going to paste the whole script here, because it's too long! this is the link and the demo as well: http://www.htmldrive.net/items/show/775/Sliding-up-form-labels-with-jquery-and-CSS3

The problem i have, is that i dont know how to make it work for input:password - currently it's set to:

jQuery( 'input:text' ).each( function( )

if i put jQuery( 'input:text, input:password' ).each( function( ) script is not working anymore!

Any solution? i don't have too much javascript or jquery knowladge - thanks!

Upvotes: 0

Views: 278

Answers (2)

David Thomas
David Thomas

Reputation: 253446

Changing the initial selector from: jQuery('input:text') to: jQuery('input:text, input:password') makes it work for me: JS Fiddle demo (incidentally the 'zip' field is the only input:password that I used, but, still, it does work as expected).

This is in Firefox 4.x and Chromium 11 on Ubuntu 11.04, though I can't see why it shouldn't work in other browsers on other platforms.

References:

Upvotes: 1

Nobita
Nobita

Reputation: 23713

Try this:

$("input:password").each(function(){
    alert($(this).attr('name'));
});

You can see it live here: http://jsfiddle.net/Uhhxf/2/

Upvotes: 1

Related Questions