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

How do I not allow spaces in masked input?

3 Answers 393 Views
Input
This is a migrated thread and some comments may be shown as answers.
bemara57
Top achievements
Rank 1
bemara57 asked on 28 May 2008, 03:36 PM
I have a masked input that is only supposed to accept a phone number. The problem is that people can enter spaces, or even if you type a letter, it won't allow it, but it will put a space instead. Does anyone know how to not allow spaces? This is how my masked input looks like:

                            <telerik:RadMaskedTextBox ID="PhoneRadMaskedTextBox" runat="server"
                                Mask="(###) ### - #### Ext. #####"
                                PromptChar="">
                            </telerik:RadMaskedTextBox> 

3 Answers, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 29 May 2008, 07:33 AM
Hi bemara57,

I've been unable to reproduce the behavior you describe with the RadMaskedTextBox markup provided. Is there anything else on your page that might interfere with it? Please verify that you are using the latest version of RadControls for ASP.NET AJAX and if still having problems - provide more info.

All the best,
Steve
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
bemara57
Top achievements
Rank 1
answered on 29 May 2008, 12:53 PM
That's really strange. I'm using the latest 515 version. This is all I have on the page:

<%@ Page Language="C#" %> 
 
<%@ Import Namespace="System" %> 
<%@ Import Namespace="System.Collections" %> 
<%@ Import Namespace="System.Configuration" %> 
<%@ Import Namespace="System.Data" %> 
<%@ Import Namespace="System.Web" %> 
<%@ Import Namespace="System.Web.Security" %> 
<%@ Import Namespace="System.Web.UI" %> 
<%@ Import Namespace="System.Web.UI.HtmlControls" %> 
<%@ Import Namespace="System.Web.UI.WebControls" %> 
<%@ Import Namespace="System.Web.UI.WebControls.WebParts" %> 
<%@ Import Namespace="Telerik.Web.UI" %> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
 
<script runat="server">  
    protected void Page_Load(object sender, EventArgs e) 
    { 
 
    } 
</script> 
 
<html xmlns="http://www.w3.org/1999/xhtml"
<head id="Head1" runat="server"
    <title></title
</head> 
<body> 
    <form id="form1" runat="server"
    <asp:ScriptManager ID="ScriptManager1" runat="server" /> 
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" EnableAJAX="true"
    </telerik:RadAjaxManager> 
 
    <div> 
 
        <telerik:RadMaskedTextBox ID="HomePhoneMaskedTextBox" runat="server" 
            Mask="(###) ### - ####"
        </telerik:RadMaskedTextBox>   
 
    </div> 
    </form> 
</body> 
</html> 
 

Just to clarify, this is supposed to take just numbers. But if you type letters, it will put a space instead. You can even put spaces too.
0
Konstantin Petkov
Telerik team
answered on 30 May 2008, 11:59 AM
Hello bemara57,

Do you get the problem in Firefox only? We are aware of a similar issue and will do our best to resolve it shortly. It does not affect IE, though. Let us know it it is the same problem you get.

All the best,
Konstantin Petkov
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Input
Asked by
bemara57
Top achievements
Rank 1
Answers by
Steve
Telerik team
bemara57
Top achievements
Rank 1
Konstantin Petkov
Telerik team
Share this question
or