For Programmers: Free Programming Magazines  


Home > Archive > ASP .NET > February 2005 > Changing text box value









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Changing text box value
John

2005-02-27, 8:59 pm

Hi

I have users entering dates in a text box. Is there any way I can change the
year to two digits (like 1/1/05) if they enter only one digit (like 1/1/5)?

Thanks

Regards


Lucas Tam

2005-02-28, 3:59 am

"John" <John@nospam.infovis.co.uk> wrote in
news:Ox3OnySHFHA.4032@TK2MSFTNGP12.phx.gbl:

> Hi
>
> I have users entering dates in a text box. Is there any way I can
> change the year to two digits (like 1/1/05) if they enter only one
> digit (like 1/1/5)?



If you want the change to occur before postback, you'll have to use
Javascript.

Otherwise you can just do it in code... but you'll need to do a lot of text
parsing.


--
Lucas Tam (REMOVEnntp@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
[url]http://members.ebay.com/aboutme/spot18/[/url]
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2010 codecomments.com