Avatar of Guru Ji
Guru JiFlag for Canada

asked on 

Auto Format Text Box when User leaves the field

I have this field below

     <tr bgcolor="#ECE9D8">
        <td style="width: 171px"><span class="style8"><strong>Account Number:</strong></span></td>
        <td style="width: 220px"><input id="Text20" style="width: 213px" type="text" / size="20" name="acctnum"></td>
      </tr>
What I want to do is AutoFormat the text entered by a user when they leave the textbox

Do if the user enters 5060012345609 OR 506001234569

IT SHOULD FORMAT ITSELF TO 50600-123456-09 OR 50600-123456-9

PLEASE HELP
ASP.NET

Avatar of undefined
Last Comment
Tanglin05
ASKER CERTIFIED SOLUTION
Avatar of dfu23
dfu23

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of Guru Ji
Guru Ji
Flag of Canada image

ASKER

Thanks, it does format the textbox, but looks like this script mess up the pc big time.

as after running it on my pc, I am unable to select that box again, The moment i Click on any box including that acctnum one, it just takes me to the end of the box and won't let me select the text atall.

If I select anything in the drop down menu it just goes to the end of the menu so fast, and its all happening since I a ran the script.

Is there any possibility to tweak the above code to run it only once
Avatar of Tanglin05
Tanglin05

Write-

I'd suggest you look at Peter Blums VAM controls. They are cheap. Powerful. And do exactly what you want:

http://www.peterblum.com/VAM/DataEntryControls.aspx?ReturnUrl=Home.aspx%23DataEntry

You may also want to check out the Telerik r.a.d.input control:

http://www.telerik.com/demos/aspnet/Input/Examples/Functionality/OrderForm/DefaultCS.aspx

Do those work for you?

Thanks~
Todd
Avatar of Tanglin05
Tanglin05

ASP.NET
ASP.NET

The successor to Active Server Pages, ASP.NET websites utilize the .NET framework to produce dynamic, data and content-driven web applications and services. ASP.NET code can be written using any .NET supported language. As of 2009, ASP.NET can also apply the Model-View-Controller (MVC) pattern to web applications

128K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo