Current filter:
                                You should refresh the page.
                                  • When using an ASPxTextBox with password = true the nulltext is not displayed. The nulltext is typically an aid of some sort for the user. So it would seem appropriate to show the nulltext if password=true.
                                    Proposed Solution:
                                    Display NullText even if the Password property is set to True.

                                2 Solutions

                                Creation Date Importance Sort by

                                Implemented:


                                Additional information:

                                Now ASPxTextBox displays null text when the Password property is set to True. You can try this functionality in the Data Editors - Null Text demo after version 14.1 is released.

                                Temporary Solution:
                                It is possible to change a type of the ASPxTextBox input programmatically:
                                - The "text" (empty) type - for an empty editor (NullText);
                                - The "password" type - for a non-empty editor (password chars).

                                [JavaScript]
                                function IsOldIE() { return ASPxClientUtils.ie && (ASPxClientUtils.browserMajorVersion < 9); } function SetInputType(input, newTypeValue) { if (IsOldIE()) //Only for IE 8 input.attributes("type").nodeValue = newTypeValue; else input.type = newTypeValue; } function txtPassword_Init(s, e) { if (s.GetText() != "") SetInputType(s.GetInputElement(), "password"); } function txtPassword_GotFocus(s, e) { SetInputType(s.GetInputElement(), "password"); } function txtPassword_LostFocus(s, e) { if (s.GetText() == "") SetInputType(s.GetInputElement(), ""); }

                                WebForms:

                                [ASPx]
                                <dx:ASPxTextBox ID="txtPassword" runat="server" NullText="Enter Password"> <ClientSideEvents Init="txtPassword_Init" GotFocus="txtPassword_GotFocus" LostFocus="txtPassword_LostFocus" /> </dx:ASPxTextBox>

                                MVC:

                                [C#]
                                @Html.DevExpress().TextBox(settings => { settings.Name = "txtPassword"; settings.Properties.NullText = "Enter Password"; settings.Properties.ClientSideEvents.Init = "txtPassword_Init"; settings.Properties.ClientSideEvents.GotFocus = "txtPassword_GotFocus"; settings.Properties.ClientSideEvents.LostFocus = "txtPassword_LostFocus"; }).GetHtml()

                                Please note that this approach brings some accessibility disadvantages: NullText (WaterMark) is not as easily accessible as an external text-aware element (e.g., a span, label, etc.).
                                UPDATE:
                                We have been informed about several issues with IE8 and tried to found a workaround, but with no avail. The previously suggested workaround prevented an exception from being raised in IE8, but the Password mechanism seems to be lost. Our research shows that this behavior is caused by an IE8 limitation. According to this MSDN article, IE8 does not support dynamic properties:
                                About Dynamic Properties
                                The only solution acceptable for IE8 we found is to replace the input element dynamically. We would like to note that ASPxTextBox is a complex control that is rendered as several nested elements, and it is impossible to do this with the current control rendering mechanism. Replacing the ASPxTextBox's input element may break a complex control's hierarchy.
                                So, if you wish to achieve this functionality with IE8, we suggest you use the <input> element as described in this article:
                                HTML Input type swapping broken in IE8?
                                Please stay tuned to our progress with the implementation of this suggestion.

                                Show all comments
                                • Okan SARICA 06.15.2012

                                  doesnt work in ie
                                  code gets the browser version as 7 when i give 9 the attribute set function gives error

                                • Mike (DevExpress Support) 06.20.2012

                                  Hello,
                                  Would you please create a new ticket in our Support Center and illustrate this issue with a sample project?

                                • Stephen Nield 02.26.2014

                                  This workaround doesn't seem to work for any Browser (IE10 and Chrome included). I trace through the JavaScript and it's setting the type correctly, but no hint text is displayed still.

                                • Stephen Nield 02.26.2014

                                  By the way, I'm using MVC... does it not work for MVC?

                                • Mike (DevExpress Support) 02.27.2014

                                  Hello,
                                  Yes, this solution is applicable for the MVC TextBox Extension as well:

                                  [JavaScript]
                                  function IsOldIE() { return ASPxClientUtils.ie && (ASPxClientUtils.browserMajorVersion < 9); } function SetInputType(input, newTypeValue) { if (IsOldIE()) //Only for IE 8 input.attributes("type").nodeValue = newTypeValue; else input.type = newTypeValue; } function txtPassword_Init(s, e) { if (s.GetText() != "") SetInputType(s.GetInputElement(), "password"); } function txtPassword_GotFocus(s, e) { SetInputType(s.GetInputElement(), "password"); } function txtPassword_LostFocus(s, e) { if (s.GetText() == "") SetInputType(s.GetInputElement(), ""); }

                                  MVC:

                                  [C#]
                                  @Html.DevExpress().TextBox(settings => { settings.Name = "txtPassword"; settings.Properties.NullText = "Enter Password"; settings.Properties.ClientSideEvents.Init = "txtPassword_Init"; settings.Properties.ClientSideEvents.GotFocus = "txtPassword_GotFocus"; settings.Properties.ClientSideEvents.LostFocus = "txtPassword_LostFocus"; }).GetHtml()

                                  However, it seems that this solution can't be used in all IE versions, so this feature is still subject for further consideration.

                                • marc parthoens 04.21.2015

                                  Hi,
                                  We have this issue in web forms BUT text comes from localized resource.
                                  What do you recommend to address this?

                                • Helen (DevExpress Support) 04.21.2015

                                  Hello Marc,

                                  To process your recent post more efficiently, I created a separate ticket on your behalf: T233106: ASPxTextBox - Display NullText even if the Password property is set to True. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.