This is a migrated thread and some comments may be shown as answers.

Textbox control defaults to asterisks, when you click they disappear

3 Answers 392 Views
Input
This is a migrated thread and some comments may be shown as answers.
Brenden
Top achievements
Rank 1
Brenden asked on 04 Jun 2009, 06:27 PM
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>  

3 Answers, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 08 Jun 2009, 12:22 PM
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.
0
Brenden
Top achievements
Rank 1
answered on 08 Jun 2009, 04:18 PM
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>   

0
Brenden
Top achievements
Rank 1
answered on 08 Jun 2009, 04:45 PM
Looks like setting the InitialValue="********" for the RequiredFieldValidator does the trick.  
Tags
Input
Asked by
Brenden
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Brenden
Top achievements
Rank 1
Share this question
or