On 7/18/07, Dan G. Switzer, II <[EMAIL PROTECTED]> wrote: > You need to var the generate_to variable in the click handler. Currently > it's a global variable, which makes the second instance overwrite the first > instance. Change: > > generate_to = $(this).attr('for'); > > to: > > var generate_to = $(this).attr('for');
Thanks. This works perfectly. > Also, I think I'd change the plug-in a bit. IMO, I would make more sense to > use like: > > $("#button").generate_password("#passwordField", iLength); > > That way you can attach the behavior to any element. Also, by using a > selector for the field to update, you could update multiple fields with the > same value (in those cases where you had both a password and confirm > password fields.) I think I understand but how do I handle the #passwordField part within the plugin? Thanks, Chris.