AJAX :: Changing Mask Value For MaskedEditExtender Using Java Script

Feb 27, 2010

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

[Code]....

View 2 Replies


Similar Messages:

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.

<AjaxControlToolkit:MaskedEditExtender
ID="mskTbTicketOpenedDate"
runat="server"
TargetControlID="tbTicketOpenedDate"
Mask="99/99/9999"
MessageValidatorTip="true"
OnFocusCssClass="MaskedEditFocus"
OnInvalidCssClass="MaskedEditError"
MaskType="Date"
ErrorTooltipEnabled="True" />

Date Mask Validator:

<asp:RequiredFieldValidator
ID="rfValTbTicketOpenedDate"
runat="server"
ControlToValidate="tbTicketOpenedDate"
Display="Dynamic"
ErrorMessage="required!<br />" />
<AjaxControlToolkit:MaskedEditValidator
ID="mskValTbTicketOpenedDateInvalid"
runat="server"
ControlExtender="mskTbTicketOpenedDate"
ControlToValidate="tbTicketOpenedDate"
IsValidEmpty="false"
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:

<AjaxControlToolkit:MaskedEditExtender
ID="mskTbPhone"
runat="server"
TargetControlID="tbPhone"
Mask="999-999-9999"
ClearMaskOnLostFocus="true"
MessageValidatorTip="true"
OnFocusCssClass="MaskedEditFocus"
OnInvalidCssClass="MaskedEditError"
MaskType="None"
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 :: MaskedEditExtender Mask Not Showing On TextBox

Sep 26, 2013

I am using the AJAX Toolkit MaskedEditExtender to format some of my web form's textboxes.  When I load the page and start to enter data into the textboxes, the masking doesn't show. I've included my page code below:

<asp:TextBox ID="GrantExpendituresAmount" runat="server" Text='<%# Bind("GrantExpendituresAmount") %>'
Width="450px"></asp:TextBox>
<ajax:MaskedEditExtender ID="GrantExpendituresAmount_MaskedEditExtender"
runat="server" CultureAMPMPlaceholder="" CultureCurrencySymbolPlaceholder=""
CultureDateFormat="" CultureDatePlaceholder="" CultureDecimalPlaceholder=""
CultureThousandsPlaceholder="" CultureTimePlaceholder="" Enabled="True"
Mask="$999,999,999.00" TargetControlID="GrantExpendituresAmount">
</ajax:MaskedEditExtender>

View 1 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 :: MaskedEditExtender Mask Not Working Properly After Turning Off Readonly

Sep 24, 2010

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

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

Apr 26, 2010

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"
TargetControlID="textbox1"
Mask="999.99"
MessageValidatorTip="true"
OnFocusCssClass="MaskedEditFocus"
OnInvalidCssClass="MaskedEditError"
MaskType="Number"
InputDirection="RightToLeft"
AcceptNegative="Left"
ClearMaskOnLostFocus="True"
ErrorTooltipEnabled="True"/>
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"
TargetControlID="textbox1"
Mask="NNNNNNNNNNNN"
MessageValidatorTip="true"
OnFocusCssClass="MaskedEditFocus"
OnInvalidCssClass="MaskedEditError"
MaskType="Number"
InputDirection="RightToLeft"
AcceptNegative="Left"
ClearMaskOnLostFocus="True"
Filtered="."
ErrorTooltipEnabled="True"/>

View 1 Replies

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

Jan 18, 2010

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

[Code]....

View 4 Replies

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

Feb 1, 2010

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

[Code]....

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

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

Jul 12, 2010

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

[Code]....

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

AJAX :: Removing Mask On MaskedEdit?

Feb 27, 2010

I have a masked edit control

[Code]....

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

AJAX :: Mask Holidays In Calendar?

Jun 1, 2010

I have holiday manage screen (a date can be assigned with holiday)...so when user click on calendar I need to mask the days which are allocated with holidays...how to acheive this..

If possible can we show the title as holiday name when user mouse overs on date in the calendar

View 3 Replies

AJAX :: Clear Mask When Using MaskedEdit?

May 20, 2010

I'm having issues with a MaskedEdit on a textbox. I am using the the ClearTextOnInvalid property to prevent my user from inserting invalid information but when it deletes the text in textbox it does not clear the Mask.So if the user decides not to put anything in the box, I believe my code is seeing the mask as an invalid string. Is there a way to clear the mask after someone clicks out of the textbox? The ClearMaskOnLostFocus property is not working from textbox to textbox, only when no object has focus.

[Code]....

View 2 Replies

AJAX :: Mask Edit Extender With Decimal Value?

Feb 11, 2011

I have the following mask edit extender:

<asp:MaskedEditExtender
ID="txtVersion_MaskedEditExtender"
runat="server"
Enabled="True"
Mask="99.99"
MaskType="Number"
TargetControlID="txtVersion">
</asp:MaskedEditExtender>

It allows to type only decimal values, like 15.15. But when I save its value into a decimal variable the format chages to 1515.

Dim Version As Decimal
Version = CDec(txtVersion.Text)

View 5 Replies

AJAX :: MaskedEditBehavior Change Mask Dynamically?

Jan 4, 2010

how to do for changing the mask edit dynamically ?

View 1 Replies

AJAX :: Mask Edit Extender At Runtime?

Nov 2, 2010

Im trying to connect up a MaskEditExtender at runtime but the Mask Edit Extender doesnt seem to work.

Heres the code:-

[Code]....

View 2 Replies

Applying Date Mask To A Textbox Without Using AJAX Or JQuery?

Dec 4, 2010

I have a user control which contains a text box, which is added dynamically to another control containing a repeater control and then finally to the aspx. As my user control with the text box is added dynamically using code, I have learnt that using JQuery to apply a date mask won't because it is added to a placeholder and thus the id of the textbox control won't be found by the JQuery, which goes a long way to explain my problems.

Prior to trying out JQuery, I used AJAX third party control from codeplex, but I had to drop that control because of other issues.

Therefore, is there a way for me to apply a mask, such as "__/__/____" to a text box that does not reply on AJAX or JQuery?

View 5 Replies

AJAX :: Mask Edit Extender Not Working Inside Grid?

Mar 3, 2011

I have put one mask edit extender for a textbox which is inside a Gridview templete field and the MaskType="Number

Mask="99,99,999.99"My problem is described below Commas are not dispalying inside the GRidView.After clicking in the textbox its coming and immediately vanishing.

e.g. after typing it should come like this 34,56,789.00 but its coming like 3456789.00

View 2 Replies

AJAX :: MaskedEdit Extender & Validator - Save Mask Only If Value Present?

Sep 22, 2010

I want to save the input mask used in the control, but ONLY if a valid value was entered. In this markup, the mask is properly displayed and stored even if the user doesn't enter anything. Since a zero-length string is a valid value, the entered value is being stored in the database as (___) ___-____ If there is no value entered, the value stored should be a zero length string.

[Code]....

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

<cc1:MaskedEditValidator
ID="MaskedEditValidator5"
runat="server" [code]....

View 1 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??

[Code]....

View 3 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

[Code]....

View 3 Replies

AJAX :: Strange Results With MaskedEditExtender?

Oct 12, 2010

I've inherited a web project from another company, and I'm having a weird issue with a phone number mask.

If the ClearMaskOnLostFocus is "true", I lose the mask in the edit field (this is a editing screen for an existing record). If set to false, the mask is present, but the leading digit is truncated, and will write back to the DB an incorrect number if submitted, with that leading "_".

True = 8885551212
False=(_88)-555-1212
The DB field a a varchar(20) -- don't ask me why.
<asp:MaskedEditExtender ID="MaskedEditExtender3" runat="server"
learMaskOnLostFocus="true" MaskType="Number"
Enabled="True" Mask="(999) 999-9999"
TargetControlID="Phone_Number">
</asp:MaskedEditExtender>

I'm recently back at work after a long layoff period, and my ASP is a little rusty.

View 1 Replies







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