javascript - Which is the best approch for numerical input in a textbox? -


i have textbox user enters id. id stored integer.

so, question is, should validate textbox after user enters value , clicks "search" button or should user allowed enter numbers?

i have solution both in javascript/jquery. not sure in terms of performance.

from functionality pov, should validate user may input numbers in numeric field, there data consistency. also, in experience, users when validate input right when they're typing it.

from safety pov, should server validate guarantee data consistency in database.

in conclusion should validate both ways. shouldn't excessively resource consuming forced choose 1 option only.


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -