473,322 Members | 1,522 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

input mask for textbox

Can someone please look at the following code that I have been using for
my asp forms and help me convert it so that I can use it on my .net
forms?? I have tried using the maskedit control and kept getting an
activeX error. I have also tried downloading the flexmaskedit and
validtext controls, but when I add them to my toolbox, they are greyed
out..

--------------------------------------------------------

function fp(Phone)

dim phoneStr

phoneStr = window.document.form1(Phone).value

pString = phoneStr
dim tempString

tempString = replace(pString," ","")
tempString = replace(tempString,"(","")
tempString = replace(tempString,")","")
tempString = replace(tempString,"-","")
tempString = replace(tempString,".","")
tempString = replace(tempString,"X","x")

if (instr(tempString,"x")) then
on error goto 0
tempString2 = split(tempString,"x",-1)
select case len(tempString2(0))
case 10
fp = "(" & left(tempString2(0),3) & ") " &
right(left(tempString2(0),6),3) & "-" & right(tempString2(0),4)
case 7
fp = left(tempString2(0),3) & "-" & right(tempString2(0),4)
case else
msgbox ("Please put the phone/fax number the following format
(###) ###-#### x####")
end select
window.document.form1(Phone).value = fp & " x" & tempString2(1)

else
select case len(tempString)
case 10
fp = "(" & left(tempString,3) & ") " & right(left(tempString,6),3) &
"-" & right(tempString,4)
case 7
fp = left(tempString,3) & "-" & right(tempString,4)
case else
msgbox ("Please put the phone/fax number the following format
(###) ###-####")
end select
window.document.form1(Phone).value = fp

end if
end function

----------------------------------------------------
thanks in advance..
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 19 '05 #1
1 1913
Brian Ciarcia wrote:
Can someone please look at the following code that I have been using for my asp forms and help me convert it so that I can use it on my .net
forms?? I have tried using the maskedit control and kept getting an
activeX error. I have also tried downloading the flexmaskedit and
validtext controls, but when I add them to my toolbox, they are greyed out..


You might check this out:
http://www.eworldui.net/CustomContro...edTextbox.aspx

Cheers,
Daniel
http://www.danhendricks.com

Nov 19 '05 #2

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

Similar topics

0
by: JIM.H. | last post by:
Hello, I need to create a date input mask on my textbox as “--/--/--“, how can I do this in asp.net? Thanks, Jim.
2
by: johnp | last post by:
Hi, Our Tech department updated users to Office 2003 this week. Now the input mask in one of the applications is showing up as: (###) ###-### The input mask wizard works correctly when I...
3
by: AA Arens | last post by:
When I want the first character of a field to be Uppercased, I need to make an input mask, like >L< followed by ??????? for example. But this mask creates ____ in an unfilled field, which I don't...
1
by: Tony | last post by:
Hello everyone... Just wondering is it possible to have input mask in a textbox control? i want my phone number textbox to force the user to enter in this format (__) ____ ____ Is there any way...
1
by: msnews.microsoft.com | last post by:
How can I set input mask on TextBox control, like if I want to input "(999) 999-99-99"?
9
by: msnews.microsoft.com | last post by:
Hello. How can I set input mask for TextBox? Or can I use for mask input some other control?
2
by: msnews.microsoft.com | last post by:
Hello. How can I set input mask for TextBox in Windows Form? For example I want to mask (format) TextBox for inputing phone number like (999) 999-99-99. The TextBox must first show something like...
0
by: Christian | last post by:
Hi all, on a PocketPC 2003 dialog I want the user to enter an IP-Adress using a TextBox control. Within the TextBox control I would like to display an predefined input mask like xxx.xxx.xxx.xxx ...
0
by: jmarr02s | last post by:
I am using the following input mask 00\-A0000000. The values entered using this input mask will have one of the following formats: 14-X1234567 OR 14-1234. What must I change on the textbox...
7
desklamp
by: desklamp | last post by:
I'm a total Access newbie, please bear with me! Using Win2K/Access 2003. I'm trying to create a table in which I can store IP addresses and other information. According to Microsoft, there is no...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.