AJAX :: Phone Number Mask Format With MaskedEditExtender

Feb 21, 2011 01:07 PM

I want a TextBox with a mask like (xxx) xxx-xxxx using a MaskedEditExtender. I tried to set up the mask property to "(999) 999-9999" or "(999) 999-9999" but nothing works. It there a way I can have the mask I want?


AJAX :: MaskedEditExtender Phone Dashes In Mask

Feb 11, 2010 03:11 PM

I just started using the mask control. I have it working exactly the way I want with date but can't get the same behavior with Phone.

ErrorTooltipEnabled="True" />

Date Mask Validator:

ErrorMessage="required!<br />" />
InvalidValueMessage="Date is invalid<br />"
Display="Dynamic" />

Breaking out the required field validation helped me get the date textbox to behave the way I need. Just positioning validation messages and such. Behavior I like here is that TextBox has no mask to start (focus off of textbox). When you put the cursor in the textbox or the textbox gets focus then the mask shows up: __/__/____. As you type the underscore placeholders dissapear but the '/' chars stay in place.

And finally, this is key, when you have a correct date and take the focus away from the text box the dashes stay in place. I just realized that is because the date mask seems to fill in the blank spaces with the current date. I cannot get this behavior with a phone. Granted there is no phone mask type. Here is the phone code:

ErrorTooltipEnabled="True" />

I have tried MaskType set to number but it doesn't change the behavior. Right now the dashes dissapear when I take the focus off of the phone textbox. One thing I noticed with date is that if it is incomplete when it loses focus it fills in the rest with the current date values. Since there is no Phone mask type that behavior is not built in. Does anyone know how to set a default behavior so if you type in 55 in would automatically finish? 555-55-5555 And when you take the focus off it would keep the dashes. But if the textbox is empty I want with no focus the mask should dissapear completely.

View 3 Replies View Related

AJAX :: MaskedEditExtender - Using Mask With Number With Decimal Get The Wrong Initial Bind Value

Apr 26, 2010 08:40 AM

I have confronted a problem of using MaskedEditExtender when try to restrict user to input a number mask with mask. User input of course has no problem. The problem is when the system get the value from database or somewhere (doing assignation), the textbox show the wrong value with the following mask setting: I am writing to contribute and share my solution: example:

textbox1: 1.1 (user input) by using the following mask:
<asp:MaskedEditExtender ID="meeXML" runat="server"
When the system get back the data, textbox1 will show:
textbox1: 0.11 <- that is not the actual what I want:
the solution:
<asp:MaskedEditExtender ID="meeXML" runat="server"

View 1 Replies View Related

AJAX :: Error "Invalid Home Number. Number Should Be In The Format: 555-123-4567" With MaskedEditExtender

Oct 28, 2010 01:35 PM

My requirement is, I have one text box and that text box accepts US Format 10 digit phone number like 555-555-5555. I want when user enter 5555555555 it automatically convert this in 555-555-5555 and if he enter some wrong number then show him error and if dont want to enter any thing then there should not be any error.

<th style="width: 150px">Home Telephone </th>
<asp:TextBox ID="txtHome" runat="server" MaxLength="12" ValidationGroup="vUserDetailsB" Width="252px" CssClass="txtBox" TabIndex="19"></asp:TextBox>
<cc1:MaskedEditExtender ID="meeHome" runat="server" TargetControlID="txtHome"
AutoComplete="false" MaskType="None" Mask="999-999-9999" ClearMaskOnLostFocus="true" InputDirection="LeftToRight" />
<%-- <cc1:MaskedEditValidator ID="mevHome" runat="server" ControlToValidate="txtHome"
EmptyValueMessage="Telephone Number is required." ValidationGroup="vUserDetailsB"
ControlExtender="meeHome" InvalidValueMessage="Valid Telephone Number is required."
IsValidEmpty="false" ValidationExpression="^d{3}-d{3}-d{4}&#36;" Font-Size="8pt" />--%>
<asp:RegularExpressionValidator ID="revHome" runat="server" ControlToValidate="txtHome" Display="Dynamic" ErrorMessage="Invalid Home number. Number should be in the format: 555-123-4567" Font-Size="8pt" SetFocusOnError="True" ValidationExpression="d{3}-d{3}-d{4}"
ValidationGroup="vUserDetailsB" Width="100%" meta:resourcekey="txtHomeResource1"></asp:RegularExpressionValidator>

Whats happenening, If i entered any thing like 5555555555 and it is coverting to this 555-555-5555 format which is correct and then when i moved to another textbox it is throwing error "Invalid Home number. Number should be in the format: 555-123-4567" and this format changes to 5555555555 and its not going ahead.

View 3 Replies View Related

AJAX :: MaskedEditExtender - User Escapes Mask Disappears

Mar 26, 2007 07:29 PM

I have two pair of MaskedEditExtenders and text boxes set up as a standard form with a submit button. The form is encapsulated in an update panel with the UpdateMode=Conditional. The MaskedEditExtenders work beautifully, but when a user (code-reviewer) presses the escape key at the end of the textbox, the mask disappears. From here on, when the user submits the form, the following error is displayed:

Invalid postback or callback argument. Event validation is enabled using <pages enableEventValidation="true"/> in configuration or <%@ Page EnableEVentValidation="true" %> in a page. For security purposes, this feature verifies that arguments to postback or callback events originate from the server ocntrol that originally rendered them. if the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.

The data is validated on the server, so allowing users to remove the mask is okay, but have the error message is not. I've tried typical troubleshooting techniques to find where the problem lies (such as turning off partialPageRendering and/or disabling the MaskedEditExtenders). The form works fine when either of the pre-described changes where in effect. Has anyone experience this issue before and have a better implmentation/work around?

View 11 Replies View Related

AJAX :: Changing Mask Value For MaskedEditExtender Using Java Script

Feb 27, 2010 04:21 AM

using java script with update panel. I have checkbox, textbox with MaskedEditExtender inside update panel in web content form. I want to change the mask for MaskedEditExtender when I check the checkbox without doing pastback for the update panel using java script


View 2 Replies View Related

AJAX :: MaskedEditExtender Mask Not Working Properly After Turning Off Readonly

Sep 24, 2010 10:23 PM

I ran into a strange issue with the AJAX MaskedEditExtender control, the extender is used with the Mask="99/99/9999" and MaskType="Date". Initially when the page loads the textbox was set to readonly using textbox.Attributes.Add("readonly", "readonly") in the codebehind. After the page loads if the user clicks on a certain button it would change the textbox to editable using javascript code: textbox.readOnly = false. The strange thing is after that if you start typing in the textbox you can see the entire mask
(__/__/____) shifting to the right as you type. For example it looks something like this: 09__/__/____ instead of the normal 09/__/____.

If the textbox was never set to readonly in the first place this behavior won't happen. So it seems something got messed up when changing from readonly to not. I was able to reproduce this in a barebone aspx page with just the textbox, the mask extender, and a button that when clicked turning off the textbox's readonly. Anyone knows how I can fix this?

I'm using Ajax toolkit v3.0.30512

View 5 Replies View Related

Using AJAX MaskedEditExtender And MaskedEditValidator To Validate The Phone?

Feb 06, 2010 11:50 AM

I have text box to enter a phone number. I'm using AJAX MaskedEditExtender and MaskedEditValidator to validate the phone.I have no problem with mask but the problem nothing happen when I enter for example only 3 number then lose the focus but as soon the focus on I will see the error message and it will disappear as soon as I write one number.

all what I want to get the error message if the user did not enter 9 numbers after lose the focus.

here is my code: <asp:TextBox ID="txtHomePhone" runat="server" ontextchanged="txtHomePhone_TextChanged"></asp:TextBox>

<cc1:MaskedEditExtender ID="txtHomePhone_MEExt" runat="server" TargetControlID = "txtHomePhone" Mask = "(999)999-9999" MaskType ="Number" AutoComplete="False"

View 4 Replies View Related

AJAX :: Reach The Mask Property From The MaskedEditExtender Control In The Client Side Script?

Jan 18, 2010 06:10 PM

How do I reach the mask property from the MaskedEditExtender control in the client side javascript?


View 4 Replies View Related

How To Format A Phone Number From TextBox Control

Apr 20, 2009 05:37 PM

I have the following code and it' s not working:

The txtPhone.Text contains the number in this format: 1234567890 and I want it to: (123) 456-7890

View 3 Replies View Related

Web Forms :: Format Label Containing Phone Number?

Nov 06, 2009 03:53 AM

I have varchar(20) field called WL_MOBILE which contains value like 12345678901.I wish to display it as: 123 4567 8901 I would like to format it in the .aspx page but I cannot achieve it. It tried:


No formatting is applied and the phone number is displayed with no space.

View 1 Replies View Related

Forms Data Controls :: Format Phone Number Not Working?

Jan 06, 2010 07:30 AM

I have been attempting to find a solution for my phone number formatting problem for 2 hours now and I am not getting any closer. My 10 digit phone number is stored as a varchar(14) without any formatting (just 10 digits).

Here is the code to format the phone number in a gridview:


why the formatting won't work? It just displays the 10 numbers with no formatting.

View 8 Replies View Related

AJAX :: Mask And ValidationExpression (MaskedEditExtender - MaskedEditValidator) Validate A Field Called "RIF"

Nov 26, 2009 08:29 PM

I am not sure what I am doing wrong. I am trying to validate a field called "RIF" My mask is (letter J dash eight digit dash one digit) J-43434545-9 I tried various Mask and Validation Expressions When I enter the correct it considers it invalid

InvalidValueMessage="RIF format is invalid"

View 3 Replies View Related

AJAX :: MaskedEditExtender's - Mask Characters Don't Hide Under Typing Characters

Feb 01, 2010 08:36 AM

I have a problem with MaskedEdit's mask for the code shown below:


When I'm starting to print date in the TextBox, mask moves with characters. Mask characters don't hide under typing characters.

View 7 Replies View Related

Forms Data Controls :: Phone Mask Not Working In Grid View?

Dec 05, 2010 05:12 PM

I have read through a lot of post but cannot find the answer I'm looking for. I'm using expression web 4 and asp.net 4.0 gridview to show database search results. The search works fine but the phone number mask from the database is not coming over in the results. I have tried some examples with the database, if I remove the mask on the column in the table and manually type in the phone number (###) ###-####, it works in the results.

If I keep the mask in the database, the results are just ########## in a row. I have also tried to use the datastring under edit colums with

{0:(###) ###-####} in the box with no luck. I have the HTML encode to False and the HTML format string set to true. I still get just the straight line of numbers for the results.

The database is a Access 2007 template and I'm actually using Access 2010.

View 6 Replies View Related

AJAX :: MaskedEditExtender Looses Format When Not In Focus?

Sep 23, 2010 07:48 AM

I have a tex box which I'm using to capture a bank sort code.

I want to use the AJAX MaskedEditExtender so the user only ever inputs the data in this format 12-34-56.

Here is my extender code:


This initially works fine, however when i remove the focus on this text box the input removes any hyphen and the texbox value is left like this 123456.

View 2 Replies View Related

AJAX :: MaskedEditExtender Date Format Incorrect?

Jun 02, 2010 11:59 PM

I have a textbox for date input and I used a MaskedEditExtender to set the Mask="99/99/9999": here is the code:

<asp:TextBox runat="server" ID="tbDate" Width="80px" />
<ajax:MaskedEditExtender ID="MaskedEditExtender1" runat="server" TargetControlID="tbDate" Mask="99/99/9999" MaskType="Date" />

In my code when the page loads I need to set the tbDate to readonly, then when the user enters some other info on the page I will make tbDate editable (not readonly), I did all these using javascript by setting tbDate.readOnly = true/false. However, when
going from readonly to editable, when the tbDate field receives the focus, the mask __/__/____ appears, but when the user starts typing the first digit, it pushes the mask as if the mask was part of the value, so it becomes something like 12__/__/____ instead
of 12/__/____. If I commented out the code that makes the tbDate field readonly, then the mask works as expected.

View 2 Replies View Related

AJAX :: Masked / Mask Edit Extender Not Displaying Currency Correct When In Number Mode?

Mar 03, 2010 02:54 PM

I have found a problem with the Masked Edit Extender when using it with a culture of Azeri (Latin, az-Latn-AZ). I have not found anywhere that states that the control should not be used with languages that is not included in the list of languages that the ajax control toolkit is translated.

The currency symbol for Azeri is "man." the first problem is that the mask displays this as "man," but the comma is the decimal indicator for Azeri.

Scenario 1

When the DisplayMoney property is set to "right" and the currency is removed by the masked editors script the resulting value looks something like "12,12," the second comma then invalidates the numeric value and all my compare validator which also acts on the same textbox keeps failing because the value is not numeric.

Scenario 2:

When the DisplayMoney property is set to "left" there is always a "0," added to the string because the the script of the masked editor removes the man then gets to the comma (man",") sees it as a decimal indicator and adds the 0 before the comma this happens on the first blur of the textbox each resulting onblur event will add another 0 to the value. But the value is already invalidated by the fact that it again has two commas like 0,12,12.

I get this result even with the Ajaxcontroltoolkit sample site, the changes needed to sample site's MaskedEdit.aspx page can be seen below.

For scenario 1, change the first MaskedEditExtender on the MaskedEdit.aspx page to the following:


For scenario 2 effect change the first MaskedEditExtender on the MaskedEdit.aspx page to the following:

<ajaxToolkit:MaskedEditExtender ID="MaskedEditExtender2" runat="server"

View 3 Replies View Related

AJAX :: Displaying Currency With MaskedEditExtender In Correct Format

Dec 01, 2010 10:18 AM

I am using ASP.NET3.5. I have used MaskedEditExtender for currency purpose. when iam insering data into table it is accepting correct figures. while reading the same figures from database,I am displaying the figured in another textbox. (for second textbox i have used MaskedEditExtender) but it is displaying in that text box wrongly. suppose x=100 am reading this value from database and displaying x value in edit mode.but it is displaying 1.00. means it is taking last 2 digits as decimal points. how can I show in correct format?

View 5 Replies View Related

AJAX :: Use The MaskedEditExtender To Accept Dates In Dd/MM/yyyy Format?

Jan 06, 2009 09:15 AM

How can I use the MaskedEditExtender to accept Dates in dd/MM/yyyy format. I also want to validate the date using MaskedEditValidator.

I was able to work with dates in MM/dd/yyyy format but having issue with dd/MM/yyyy format.

View 6 Replies View Related

AJAX :: Masked Edit For Phone Number With Validation Control?

Jul 29, 2008 06:54 AM

want to know about masked edit textbox for phone number...

View 2 Replies View Related

Phone Number Is Null Or Blank?

May 19, 2010 11:06 PM


This is having problems if the phone number is NULL or BLANK. Is there a way to fix it?

View 4 Replies View Related

Displaying A Phone Number As 000-111-2222?

May 13, 2009 06:19 PM

My phone numbers are stored as 0001112222 (format) When I go to display it how do i get it to display as 000-111-2222.? Is there one of these {0:c} for it?

View 5 Replies View Related

C# - What Are The Condition To Validate A Phone Number

Dec 3 10 at 14:21

What are the condition to validate a phone number?

Well firstly it has to be a numerical value, can include the following numbers 0123456789 and the plus symbol. +

But what about the following conditions, where do you get this data?

-It has to be in the format [country dial code + area code + phone number]

-It has to be a min and max length

EDIT: also what is the min and max length of a mobile/cell phone number?

View 5 Replies View Related

Phone Number Validation Using JavaScript With .NET?

Feb 25 at 19:29

How do I validate phone numbers using JavaScript in ASP.NET?

View 2 Replies View Related

Extending Phone Number Validation To Add Extension

Mar 23, 2009 12:48 AM

I am not so great when it comes to understanding regex so I figured asking for a little help would be faster than googling the heck out of it.

^([(]{1}[0-9]{3}[)]{1}[.| |-]{0,1}|^[0-9]{3}[.|-| ]?)?[0-9]{3}(.|-| )?[0-9]{4}$

is what I have and it has been sufficient. But now, I need to allow data like this:

(800)233-7164 (431143)
(800)794-4462 (2261)

View 14 Replies View Related

Wants To Create Regular Expression For Phone Number?

Sep 25th, 2010, 01:21 PM

I want to create Regular Expression for phone number and valid digits allowed are (,),-,+,0----9. If the left bracket ( is there,then its necessay that right bracket is also there. How to create the Regular Expression for the above. I dont know how to create the regular Expression,

View 4 Replies View Related

Formulate Phone Number Database Table?

Apr 03, 2009 01:42 AM

i would like to fomulate phone number like (0208) 111 2222 on sql server database table.

which coloumn properties do i need to use and which formula?

View 4 Replies View Related

Web Forms :: Regular Expression For A Phone Number?

Jan 20, 2009 10:00 AM

i have just read about RE, honestly i didn't understand too much about it.

i need to validate a phone number in this format

(country code)-(city code)-(phone number)

for example: (25466)-(25456)-(526598) i need tpo have an unlimited number of "numbers" inside parentheses and just using numbers

View 27 Replies View Related

Finding Regex Pattern For Phone Number?

Dec 14, 2010 01:57 PM

I want regex pattern for phone number as follow.


area code should be entered in paranetheses is mandatory after area code there should be hypen and only three digit should be allowed to enter that is mandatory after 3 digit again hypen should be there that is mandatory and then 4 digit should be enter that is mandatory.

View 4 Replies View Related

Regular 'Replace' Expression For Phone Number?

Apr 23, 2010 06:12 PM

I need regular expression for splitting the phone number into two parts

for example: if I pass 1234567890 or 123-456-7890

View 2 Replies View Related

Get A Formatted Phone Number From Database As 123-123-1234?

May 20, 2010 04:05 PM

I want to get a formatted phone number from database as 123-123-1234I tried this but this is not workingtxtphone1.Text = String.Format("###-###-####", dt9.Rows(0).Item("Address"))

View 13 Replies View Related

Forms Data Controls :: How Do Apply A Mask/format To A Label Within A FormView Control

Mar 04, 2009 06:49 PM

I have a FormView control with a Social Security Number field. I have insert, edit and item templates. The value received from the DB is a 9 character string. I need to display this to the user in the form 999-99-9999.

I found a MaskedTextBox control online to use for the Insert and update templates. That is really convenient since I have a lot of things I'll need to do this with.

In the item template for the social security number I have:


In another field (a date), I use this:

Bind("BirthDate", "{0:MM/dd/yyyy}") but it doesn't work for my social security number field.

View 3 Replies View Related

Web Forms :: Fixing First 4 Characters Of Phone Number In Textbox In C#

Oct 12, 2009 11:02 AM

asllow only 10 digits in ph.no textbox, but fix first 4 digits of phone number as 9001,9002,90031,9004 only

no other (first 4)digits should be allowed

View 17 Replies View Related

Security :: Extend CreateUserWizard Control To Get Name And Phone Number?

Aug 24, 2010 12:47 AM

Im using the asp.net membership provider and I would like to know how to add fields for a first name, last name, and phone numbre on my registration page with the CreateUserWizard Control ando also how to insert this new data to tha membership database table. I already created the culumns for these but I don't know how to insert the new data from the CreateUserWizard Control.

View 3 Replies View Related

MVC :: Apply The Validation,filtered For Phone Number Textbox?

Mar 10, 2010 06:21 AM

how to apply the validation,filtered for phone number textbox.

View 4 Replies View Related

Security :: Login Form Using Either User Id Or Email Or Phone Number?

Apr 20, 2010 05:31 AM

I have to make a login form using vb.net. The login form should either accept

Username ID or

Email ID or

Phone number

---- either of one ,and match it with the password of the corresponding record in the user table.

The user table has following column:- U_ID(varchar),mail(varchar),Phone(Number),Password(Varchar)

The form has two textfields - 1. Username


And a submit button. If combination is correct I should be redirected to the Index page.

But I don't have to scan through all the columns of the user table to match the password.

(a)If the user enters user­_id say- ID 10012 then we should be able to search only the record in the user_id column as it has alphanumeric or varchar data type and match with corresponding password.

(b)If the user enters Email id we should be able to search through the email id column as email id contains "@ and ." sign.

(c)If the user enters phone number then we should search only the phone column as it has numeric datatype.

View 5 Replies View Related

DataSource Controls :: How To Convert Phone Number In SQL Select Statement

Oct 17, 2008 03:30 PM

I have a select statement that pulls a phone number field that is char(10) and load that field into a data grid. The phone number shows up 1234567890 and I want to show as (123) 456-7890 whe loading the grid. Does anyone know what I can do to get to show like that?

View 6 Replies View Related

AJAX :: Specify Two Types Of Mask In A MaskEditValidator ?

Jul 12, 2010 08:06 AM

We are using a MaskEditValidator to validate users input in a textbox which expects a date.


Our problem is that we would like that the textbox accepts two formats of date DD/MM/YYYY and DD/MM/YY, Can be possible to specify two types of mask in a MaskEditValidator ? Another idea how can we do this that users can enter the dates in the two formats and validate it ?

View 1 Replies View Related

AJAX :: Removing Mask On MaskedEdit?

Feb 27, 2010 07:03 PM

I have a masked edit control


But on post back in my button event I don't want to see the masked in the text box ( the dollar sign ).

Is there a method I can call that will wipe the mask out? I'd rather avoid having to call RegEx to clean it.

View 1 Replies View Related

Copyrights 2005-14 www.BigResource.com, All rights reserved