Textbox control defaults to asterisks, when you click they disappear

4 posts, 0 answers
  1. Brenden
    Brenden avatar
    12 posts
    Member since:
    Jun 2007

    Posted 04 Jun 2009 Link to this post

    Why does the input control (when textmode = password) default with asterisks in firefox?  IE does not have this issue.  8 asterisks appear making it seem as if a value is already in the textbox, however when you click into the textbox they disappear.

    If I place two password controls on the same page, only the first input box displays the asterisks.

    Here is a very simple page showing this issue, please advise how we can fix this.  We would like the default logic to appear with no asterisks as it may be confusing to the user.  Thanks.

    <%@ Page language="VB" AutoEventWireup="false" %>  
    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>  
      
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">  
    <html xml:lang="en-US" xmlns="http://www.w3.org/1999/xhtml">  
    <body>  
        <form runat="server" id="mainForm" method="post">  
            <asp:ScriptManager id="ScriptManager1" runat="server" />  
     
            <p>Type Old Password:</p>  
            <telerik:radtextbox Width="220px" id="OldPassword" TabIndex="1" runat="server" TextMode="Password" Skin="Vista"></telerik:radtextbox> 
             
            <p>Type New Password:</p>  
            <telerik:radtextbox Width="220px" id="NewPassword" TabIndex="2" runat="server" TextMode="Password" Skin="Vista"></telerik:radtextbox> 
     
        </form>  
    </body>  
    </html>  

  2. Dimo
    Admin
    Dimo avatar
    8450 posts

    Posted 08 Jun 2009 Link to this post

    Hi Brenden,

    The observed behavior is characteristic to Firefox, because this browser preserves the values of <input /> elements when the page is refreshed (F5 or Ctrl+R). You can workaround this by using the following approach. The issue will be resolved in the next version of RadTextBox.

    I have updated your Telerik points for this bug report. Thank you.


    <telerik:RadTextBox ID="OldPassword" runat="server" TextMode="Password"
        <ClientEvents OnLoad="PWClear" /> 
    </telerik:RadTextBox>  
              
     <script type="text/javascript"
      
     function PWClear(sender, args) 
     { 
        window.setTimeout(function() { sender.clear(); }, 1 ); 
     } 
      
     </script> 
     



    Kind regards,
    Dimo
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. Brenden
    Brenden avatar
    12 posts
    Member since:
    Jun 2007

    Posted 08 Jun 2009 Link to this post

    When the password field has a RequiredFieldValidator that code doesnt work.  It works, however when the page loads the "Required" asterisks appears next to the textbox as if they forgot to input their password.  Do you have a solution for this?  Thanks.


    <%@ Page language="VB" AutoEventWireup="false" %>   
    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>   
       
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">   
    <html xml:lang="en-US" xmlns="http://www.w3.org/1999/xhtml">   
    <head> 
     <script type="text/javascript">  
       
     function PWClear(sender, args)  
     {  
        window.setTimeout(function() { sender.clear(); }, 1 );  
     }  
       
     </script>  
    </head> 
    <body>   
        <form runat="server" id="mainForm" method="post">   
            <asp:ScriptManager id="ScriptManager1" runat="server" />   
      
            <p>Type Old Password:</p>   
            <telerik:radtextbox Width="220px" id="OldPassword" TabIndex="1" runat="server" ClientEvents-OnLoad="PWClear" TextMode="Password" Skin="Vista"></telerik:radtextbox>  
            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" ControlToValidate="OldPassword" Text="*" ErrorMessage="Required: Password" Display="Dynamic" runat="server" /> 
              
            <p>Type New Password:</p>   
            <telerik:radtextbox Width="220px" id="NewPassword" TabIndex="2" runat="server" ClientEvents-OnLoad="PWClear" TextMode="Password" Skin="Vista"></telerik:radtextbox>  
            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" ControlToValidate="NewPassword" Text="*" ErrorMessage="Required: Password" Display="Dynamic" runat="server" /> 
      
        </form>   
    </body>   
    </html>   

  4. Brenden
    Brenden avatar
    12 posts
    Member since:
    Jun 2007

    Posted 08 Jun 2009 Link to this post

    Looks like setting the InitialValue="********" for the RequiredFieldValidator does the trick.  
Back to Top