Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Textbox Validation

Status
Not open for further replies.

johnc83

Technical User
Jan 29, 2008
154
GB
Hi all,

I have an annoying problem and would appreciate help please..

My textbox is bound to a numeric table field. If a user types in something other than a number then it won't let them leave the box.

Don't get me wrong, validation is a necessary thing but I would like the user to have the option of pressing escape or something like that to cancel his changes and carry on with his work, instead of being forced to enter a (possibly wrong) value just to get going again.

Could someone tell me how they would handle a situation like this please?
Thanks

John

.NET 2.0, Visual Studio 2005, SQL Server 2005 Express
 
On text enter, save value.

On text change, validate entries.

On text leave(or esc/tab), if not valid revert to old value.

-Sometimes the answer to your question is the hack that works
 
Hi, thanks very much for the reply.

I'll give that a go, sure it will work great.

Cheers
John

.NET 2.0, Visual Studio 2005, SQL Server 2005 Express
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top