Using AJAX MaskedEditExtender And MaskedEditValidator To Validate The Phone?

Feb 6, 2010

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

Similar Messages:

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

Nov 26, 2009

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

AJAX :: Configure MaskedEditExtender & MaskedEditValidator?

Oct 13, 2010

have a C#/ASP.NET web application that contains DetailsView controls that are used for CRUD operations through the EntityDataSource and Entity Framework. Unfortunately I'm not sure which forum would be best to post this under, since I am wondering whether either the MaskedEdit AJAX controls or Entity Data Model could be configured to allow for this.ProblemThe Entity Framework requires time fields to be of time(7) data type, which must be entered as 24-hour time, with seconds (e.g. '09:30:00'). However, I want the time entered in 12-hour time and without seconds (e.g. '9:30 AM'). Is there a way I can configure the MaskedEditExtender and/or MaskedEditValidator to allow for this. What I was thinking is possibly using the AutoComplete portion of this control to fill in the remaining portions (i.e. seconds) that the user does not enter, but which the EF requires. Either that or can the Entity Data Model or something else be configured to allow for this?Existing Code

<asp:TemplateField HeaderText="Start Time" SortExpression="StartTime">
<asp:TextBox ID="txtStartTimeEdit" runat="server" Text='<%# Bind("StartTime") %


View 3 Replies

AJAX :: Custom Textbox Using MaskedEditExtender And MaskedEditValidator?

Aug 23, 2008

this is exactly what I do:

public class MyTestTextBox : TextBox
#region Fields
private MaskedEditExtender _mee;
private MaskedEditValidator _mev;
#region Constructors
public MyTestTextBox()
: base()
this._mee = new MaskedEditExtender();
this._mev = new MaskedEditValidator();
#region Methods
protected override void CreateChildControls()..........

View 4 Replies

AJAX :: MaskedEditExtender And MaskedEditValidator Causing Refresh/postback?

Sep 7, 2010

I have the following tabpanel (it actually contains a bit more content, but that content doesnt influence my issue):


When I remote the MaskedEditExtender and MaskedEditValidator, it doesnt show that (undesired) behaviour anymore.Is there something special these controls do that cause them to refresh? Is there a workaround for this?

View 1 Replies

AJAX :: MaskedEditExtender Phone Dashes In Mask

Feb 11, 2010

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

AJAX :: Phone Number Mask Format With MaskedEditExtender

Feb 21, 2011

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?

View 2 Replies

AJAX :: MaskedEditValidator Validate A Date?

Jul 31, 2007

I have a textbox and an image on a website. When I press the image, the calendar is extended (works!); also, I use a masked edit extender to show the right mask (works!)But when I use the MaskedEditValidator to get the date input validated, this is where I get stuck :s (doesn't work [:S])I added my very simple demo code below, can someone tell me what I am doing wrong?For example, when I input a date like 99/99/9999, the Validator doesn't complain, but it isn't a valid date :sMy code:


View 2 Replies

How To Use MaskedEditExtender And MaskedEditValidator

Feb 20, 2010

Well i cannot find a solution,so..

I will post my code.The problem is that whatever date i try (i use greek d/m/y but i also tried m/d/y) it gives me the "error!" tooltip.

I've tried complex code,simple code, ValidationExpression,Globalization,no globalization.Nothing works.
Anyway to it's simplest form:



View 10 Replies

AJAX :: Using "MaskedEditExtender" Along With "MaskedEditValidator"?

Mar 11, 2011

I am Using "MaskedEditExtender" along with "MaskedEditValidator" in my page with a textbox. it is not working and showing the NullReference exception. the call stack showing the following details

[NullReferenceException: Object reference not set to an instance of an object.]
AjaxControlToolkit.MaskedEditValidator.OnPreRender(EventArgs e) in C:UsersswaltherProjectsAspNetAjaxReleases30930AjaxControlToolkitSourceAjaxControlToolkitMaskedEditMaskedEditValidator.cs:384

View 3 Replies

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

Dec 3, 2010

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

AJAX :: MaskedEditValidator / Strange Behaviour?

Dec 20, 2010

I am using the MaskedEditExtender and MaskedEditValidator, but have experienced some strange
behaviour. (See code example below). When entering a date into the textbox this is what I see:

1. The mask

2. Entering the date and time e.g. "19-01-1980 10:11:12"

3. When removing focus from the textbox the result is: "19-01-1980 19:01:19"

The six first digits of the date is copied as the time? If entering a day of the month larger than 23 and any given month, year and time (eg. 25-10-1980 12:12:12) the validation fails as the six first digits are copied to the time resulting in a time 25:10:19 which obviously is not valid.

I have downloaded the AJAX toolkit sample code and experience the exact same behaviour. When running the AJAX Toolkit samples from[URL] works fine!

Additinal info: Culture is danish (DateTime format is dd-MM-yyyy hh:mm:ss). Tried changing my systems culture to en-US but same behaviour.



View 5 Replies

AJAX :: Disable MaskedEditValidator Through JavaScript?

May 13, 2010

I'm trying to disable a MaskedEditValidator control through JavaScript.

The following approach works for other types of validors (RequiredFieldValidator) but doesn't seem to work for the MaskedEditValidator


View 2 Replies

AJAX :: MaskedEditValidator And MinimumValue Property - How To Set Dates

Feb 16, 2011

I have 2 scenarios here for using the MaskedEditValidator for a date field. I'll start with the easier one first.

1) I have a date field. I want to set the MaskedEditValidator's minimum value property to TODAY's date. So for example, if the user enter's a date earlier than today, the AJAX control will show a message stating "you can't input a date earlier than today".

2) I have 2 date fields - 1st one is 'start date' and 2nd one is 'end date'. I want to set the MaskedEditValidator for the end date so that the minimum value property is the date from the 'start date' field. So this way, the user can't enter a date in the 'end date' field that is earlier than what is in the 'start date' field.

Are these 2 scenarios possible? Or should I try another option (Javascript, Jquery, etc...)?

View 1 Replies

AJAX :: Bugs Using MaskedEditValidator When Checking Date?

Nov 30, 2009

I am facing a problem when using ajaxcontroltoolkit 30305121 or 3.0.20229.0 version. The following code is using calendarextender which is format with 'yyyy/MM/dd' and then the mask of maskededitextender is '9999/99/99', it is working fine when I am using '99/99/9999', but it cannot work with '9999/99/99'.

<asp:TextBox ID="txtStartDate" runat="server" Width="105px"></asp:TextBox>
<asp:Image ID="Image1" runat="server" ImageUrl="~/images/DateSelector.gif" />
ID="CalendarExtender1" runat="server" PopupButtonID="Image1" TargetControlID="txtStartDate"


View 6 Replies

AJAX :: MaskedEditValidator And Panel's DefaultButton Not Working?

Mar 16, 2010

I have a panel, with several textboxes and an ImageButton inside of it. One of the textboxes has a MaskedEditExtender and a MaskedEditValidator associated with it. When I hit enter from any other textbox besides the one with the MaskedEditValidator the defaultbutton that is defined in the Panel's DefaultButton property handles the enter key.However, when I am in the textbox with the MaskedEditValidator, the first button on the form is receiving the enter key. Now, if I take the MaskedEditExtender off of the page, and just leave the MaskedEditExtender, everything behaves as it should.Can anyone offer any insight into how I may get this to work properly, or is this a known bug?I tried searching the forums and found a similar post, but no conclusion was ever reached.

View 3 Replies

AJAX :: Trying To Disable A MaskedEditValidator Control Through JavaScript?

Oct 28, 2009

I'm trying to disable a MaskedEditValidator control through JavaScript.

The following approach works for other types of validors (RequiredFieldValidator) but doesn't seem to work for the MaskedEditValidator


View 2 Replies

AJAX :: MaskedEditValidator MaskedEditServerValidator Event Is Not Working After PostBack?

Mar 15, 2007

Protected Sub MaskedEditValidator_MaskedEditServerValidator(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.ServerValidateEventArgs) Handles MaskedEditValidator.MaskedEditServerValidator
If Me.rbStlRentalInclu.checked Then
e.IsValid = False
End If
End Sub

The MaskedEditValidator did not show Invalid Message after postback, why?

View 11 Replies

AJAX :: Can't Get The MaskedEditValidator To Work With The ValidationSummary In Ways Of Separate Information

Nov 13, 2007

I can't get the MaskedEditValidator to work with the ValidationSummary in ways of separate information: a '*' next to the textbox, and a string message in the validator.


Question: With 'standard' validation controls, they put the "ErrorText" value in the ValidationSummary, and the "Text" value right next to the TextBox. But the AJAX Validators don't handle different messages for next to the textbox and summarry.

Am I doing something wrong? Or is it just not possible.

View 3 Replies

AJAX :: MaskedEditValidator Outside Gridview Disable Delete Command In ItemTemplate Field

Jul 8, 2010

Something "weird" is happening with my ASP.NET application. I have a MasterPage with WebForms, and inside one of them, I have an ASP TextBox which is controlled by the MaskedEditExtender/MaskedEditValidator couple. Underneath, I have a GridView with 2 columns, an Edit ASP Command Field, an ItemTemplate which contains an ASP ImageButton with a Delete CommandName linked to a GridViewDelete Event through the OnRowDeleting attribute. The GridView is binded with SQL Server data while the page is loading.

It appears that once the page is loaded, if I want to delete a row by clicking on the ASP ImageButton, nothing appears. I have first to do something else with the GridView (raise an Edit Event for example), then it's accessible. I try different stuff to catch the source of the problem, and the "weird" part appeared when I deleted the MaskedEditValidator, just keeping the MaskedEditExtender : the Delete ASP ImageButton worked since the page loads!

View 2 Replies

AJAX :: Removed-added The Toolkit Toolbox / The Error Occurs P.e. In MaskedEditvalidator?

Feb 19, 2010

So basically when i open the page i get the error above.

I've removed-added the toolkit toolbox.The error occurs p.e. in MaskedEditvalidator when i remove the mask from

MaskedEditExtender.Ok i know that it probably needs a mask and it crashes but what the hell is the

C:UsersswaltherProjectsAspNetAjaxReleases30930AjaxControlToolkitSourceAjaxControlToolkitMaskedEditMaskedEditCommon.cs ?? I don't even use c: for any project.Who is swalther?WTH?

And is there a MaskedEditCommon.cs in the toolkit?I did not find any MaskedEditCommon.cs in whatever, version library or whatever i downloaded.

Error:[ArgumentOutOfRangeException: StartIndex cannot be less than zero. Parameter name: startIndex] System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy) +7490863 System.String.Substring(Int32 startIndex, Int32 length)

View 1 Replies

AJAX :: Can Use A MaskedEditExtender With A Combo Box

Feb 23, 2011

I want masked ComboBox, so I use a MaskedEditExtenderwith a ComboBox. The two controls came from the ajax control toolkit. But I got an error: "Unable to cast object of type 'AjaxControlToolkit.ComboBox' to type 'System.Web.UI.WebControls.TextBox'". Is there a way a can use a MaskedEditExtender with a combo box?

View 4 Replies

AJAX :: MaskedEditExtender Multilanguage?

Sep 26, 2010

runat="server" [code]....

View 1 Replies

AJAX :: What Could Cause MaskedEditExtender To Be So Slow

Dec 18, 2009

30 seconds or more to display the date after it's typed in on some computers.

View 3 Replies

AJAX :: MaskedEditExtender Decimal Values?

May 10, 2010

I am using MaskedEditExtender on my textbox.Set the masktype to number.Now the user can enter decimals also at any place to my textbox.Is it possible for my MaskedEditExtender to still accept that or I have to use custom javascript/ regex for this.

View 5 Replies

AJAX :: MaskedEditExtender Gets Focus On Postback?

Sep 2, 2010

I'm having a really strange issue with the MaskedEditExtnder. I've attached some markup for one of the textboxes. I'm using a MaskedEditExtender and MaskedEditValidator along with a CalendarExtender so the user has the option to type the date or click on an image and pick the date.

So, if I enter/pick a date then select a control that forces a postback (usually a dropdownlist but not always) when the page is returned the focus goes back to the textbox I just entered the date in. So what about the MaskedEdit, MaskedEditValidator, CalendarExtender would cause the page to return focus to the control being extended? See markup below - am I missing something??


View 3 Replies

AJAX :: Set The Focus-position In MaskedEditExtender?

Jul 17, 2007

I've played around a bit with the MaskedEditExtender.. However when looking into the

sample web site you'll see, that the cursor is placed just before the decimal-sign, when entering the number field. I like that behavior, but I cannot get it to work. There is no property setting this, as I see it.

Has anyone managed to set the focus-position in MaskedEditExtender like at the sample web site?

View 3 Replies

AJAX :: Set Decimal Value To MaskedEditExtender Textbox?

Nov 22, 2009

I have a textbox with MaskedEditExtender.In Which,I've set mask as '999.99'.Problem is ,When i get the decimal value from database and assign to textbox.It shows the wrong value.For example,When I assign the decimal value 89.95 from database.textbox shows 899.50 instead of 89.95.

View 4 Replies

AJAX :: MaskedEditExtender Not Functioning Properly

Jun 7, 2010

I'm having a issue with a MaskedEditExtender, I am using it for a datetime field with the sqltable field definition as smalldatetime, I have several error messages such as emptyvalue error message, minimium value error message along with a few others.

Everything works fine until i put a maximium value, on selecting either insert or edit it throws the error even if the date entered is between the minimium value and the maximium value and will not go away. As you are aware smalldatetime has a max value of 06/06/2079 which won't be a issue in my lifetime but for validation purposes I want to make sure the user doesn't accidentally enter a value larger than the max value thus causing an error on insert or edit.

View 6 Replies

AJAX :: How To Clear The Textbox Associated MaskedEditExtender

May 24, 2010

the code like below, how to clear tbxDate when input an invalid date use javascript


View 3 Replies

Copyrights 2005-15, All rights reserved