i have a login component and within it the password field has a textmode of singlline
what i am trying to do is on focus the textmode will change to password
i tried this :
$(function () {
$(".PassTextBox").focus(function (pas) {
$(".PassTextBox").attr("TextMode", "Password");
});
});
but it didn’t work
using asp.net 3.5 , thanks
You’ll need to change the “type” attribute to password. “TextMode” is an asp.net control attribute, but on the client side it gets turned into an HTML input, which has a type attribute: http://htmlhelp.com/reference/html40/forms/input.html
UPDATE:
After testing this to confirm it works, it appears changing the type may not be supported on all browsers or by jQuery. This answer will give you some more insight. My suggestion is to put two fields on the form and dynamically show/hide them to give the same effect.