PDA

View Full Version : [CLOSED] TextField InputType = Password EmptyTest is masked



SFritsche
Mar 13, 2013, 10:38 PM

Baidaly
Mar 13, 2013, 11:22 PM
Hello!


I have found that setting the EmptyTest on a text field set as InputType=Password renders with the Empty Text masked.

Sorry, I don't quite understand you. What you want to change? You want to remove mask? Also, can you say what version of Ext.NET and browser do you use?

SFritsche
Mar 14, 2013, 4:14 PM
Yes, when the control's value is empty, I want the EmptyText value to show unmasked. Once the control gets focus, I want the characters that I type in to be masked. To do this, I was trying to change the InputType at the client level on the fly. It seems like the browser does not allow that. Any ideas?

IE 9
Ext.NET v 2.1

Thanks.
-Steve

Daniil
Mar 14, 2013, 5:32 PM
Hi Steve,

Yes, I doubt it is possible to change an inputType of the fly.

Maybe something like this.

Example

<%@ Page Language="C#" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<!DOCTYPE html>

<html>
<head runat="server">
<title>Ext.NET v2 Example</title>
</head>
<body>
<form runat="server">
<ext:ResourceManager runat="server" />

<ext:Container
runat="server"
Height="22"
Width="150"
Layout="CardLayout">
<Items>
<ext:TextField runat="server" EmptyText="Password" SubmitValue="false">
<Listeners>
<Focus Handler="this.up('container').layout.setActiveItem(1);" />
</Listeners>
</ext:TextField>
<ext:TextField runat="server" InputType="Password">
<Listeners>
<Activate Handler="this.focus();" />
<Blur Handler="if (this.getValue() === '') {
this.up('container').layout.setActiveItem(0);
}" />
</Listeners>
</ext:TextField>
</Items>
</ext:Container>
</form>
</body>
</html>

SFritsche
Mar 14, 2013, 8:46 PM
Daniil,

That is a very nice solution. I will work with that. Thank you.

-Steve