Click here to Skip to main content
15,893,588 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi
I have one form in that , one textbox i want to apply special char,number,etc., in that textbox only.
for example:



XML
<form id="form1" runat="server">
    <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
    </asp:ToolkitScriptManager>
    <div>
    <asp:TextBox ID="Txt1" runat="server"></asp:TextBox>
<asp:FilteredTextBoxExtender ID="FilteredTextBoxExtender5" runat="server" FilterType="Custom"
    ValidChars="A" TargetControlID="Txt1" />
    <asp:FilteredTextBoxExtender ID="FilteredTextBoxExtender1" runat="server" FilterType="Custom"
    ValidChars="012" TargetControlID="Txt1" />



How to apply





thanks in advance.
Posted
Updated 10-Jun-15 23:38pm
v2
Comments
CHill60 11-Jun-15 5:48am    
Do you mean you only want non-alpha characters to be allowed to be input into the textbox? You want to filter the valid characters?
Member 11686116 11-Jun-15 5:51am    
yes in the same textbox i want one uppercase letter on e special char, one num.like that
Member 11686116 11-Jun-15 6:07am    
Any idea?

1 solution

Have a look at this blog[^] - it has several examples

... that you can adapt to your own needs. See the way the FilterType can be changed. In your case you probably need to do something like

VB
FilterType="Numbers, Custom"

    ValidChars=".@+-"

Or whatever the list of characters you want to accept might be
 
Share this answer
 
v2
Comments
Member 11686116 11-Jun-15 6:15am    
But i want for same Textbox. that is for different textboxes.
CHill60 11-Jun-15 6:27am    
You have to use the examples to work out how to set up the filtertype - see my amended solution
Member 11686116 11-Jun-15 6:32am    
Thts fine but i want my textbox like only five characters range should there
Like first letter should b UpperCase 2nd one Number 3rd one spl character like that.but It shoul be only five characters.if am typing 6th charcter it shld not allow.
Member 11686116 11-Jun-15 6:34am    
Just like unique Id
Member 11686116 11-Jun-15 6:40am    
And Valid chars="@,A,a" if we give like this then in o/p it is applied for AAAA soon.... but i want only once "A" like this.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900