473,503 Members | 1,787 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem in MaskedEditExtender with javascript

Hi All,

i have 3 textboxes for area Code,phone number and Extention and each have
MaskedEditExtender associated with it.

i want that when the length of first text box reaches it's maxlength , focus
will be set to next textbox automatically, means i want auto tabbed fields.
for which i created java script function and associated it with OnKeyDown
and OnKeyUp event of TextBox. but it's not working and when i remove the
MaskedEditExtender it workes fine, Can anyone please guide me.
heare is my aspx code(here i am showing only 1 textbox but i have 3 textbox):-

<asp:TextBox ID="txtAreaCode" runat="server" Width="25px" MaxLength="3"
size="4" ></asp:TextBox>
<AjaxToolKit:MaskedEditExtender ID="meeAreaCode" runat="server"
TargetControlID="txtAreaCode"
AutoComplete="false" Mask="999" MaskType="None"
InputDirection="LeftToRight"
ClearMaskOnLostFocus="False" PromptCharacter=" "
OnFocusCssClass="MaskedEditFocusNegative"
OnInvalidCssClass="MaskedEditFocusNegative">
event association:-

String areaCodeDown = "javascript:TabNext(this,'down', " +
this.txtAreaCode.MaxLength + ",)";
String areaCodeUp = "javascript:TabNext(this,'up', " +
this.txtAreaCode.MaxLength + ",'" + this.txtNumber.ClientID + "')";

this.txtAreaCode.Attributes["OnKeyDown"] = areaCodeDown;
this.txtAreaCode.Attributes["OnKeyUp"] = areaCodeUp;

Javascript function :-
var phone_field_length=0;
function TabNext(obj,event,len,next_field)
{

if (event == "down")
{

phone_field_length=obj.value.length;

}

else if (event == "up") {

if (obj.value.length != phone_field_length)
{

phone_field_length=obj.value.length;

if (phone_field_length == len)
{

var next=document.getElementById(next_field);

if(next != null)
next.focus();

}

}

}

}
Thanks
Aug 5 '08 #1
0 1789

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
2294
by: Aaron Prohaska | last post by:
I have just run into a problem where I have a page that posts back to itself to execute code, except when the page does the post back it somehow executes code that is in our home page for the site....
4
4731
by: Federico Bari | last post by:
Good morning all from italy, i have probably a compatibility problem with a html/javascript page. The aim of the code of the file test.htm you find here following (copy the 3 files in the...
4
3816
by: JesusFreak | last post by:
From: us_traveller@yahoo.com (JesusFreak) Newsgroups: microsoft.public.scripting.jscript Subject: toolbar script problem NNTP-Posting-Host: 192.92.126.136 Recently, I downloaded the following...
1
1993
by: Julius Mong | last post by:
Dear all, according to the ASV3 manual known problem section, to make an <a> execute some Javascript onclick: ...
12
9615
by: Jeff S | last post by:
In a VB.NET code behind module, I build a string for a link that points to a JavaScript function. The two lines of code below show what is relevant. PopupLink = "javascript:PopUpWindow(" &...
1
8189
by: mickeybaez | last post by:
Hi, I am trying to get the maskededitextender in asp.net to work. It seems like it does not let me type in the box. I have the scriptmanager and also have the maskededitextender configured to point...
0
900
by: foram | last post by:
Hi everyone, i have develop one application..it is AjaxbasedApplication and i am also using Ajax control toolkit and i have use ajaxToolkit:MaskedEditExtender control so on pressing one btn i...
1
2762
by: avanthika | last post by:
Hi, <form id="form1" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server" /> <asp:TextBox ID="txtDate" runat="server" Width="182Px" ></asp:TextBox> ...
0
2623
by: Bobby Edward | last post by:
I am using the ajax maskededitextender to provide a phone number format template, like this: (000)000-0000 x0000 Is there any way that I can automatically strip out the parens, dash, etc......
0
7273
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6982
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7451
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5572
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5000
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4667
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1501
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
731
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
374
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.