Link to home
Start Free TrialLog in
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
ASKER CERTIFIED SOLUTION
Avatar of dfu23
dfu23

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Guru Ji

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