View Full Version : Validating a textbox

Apr 12th, 2007, 02:30 PM
Hello, I'm new in using javascript ,I'm developing an asp web app and I want to validate some textboxes but I don't Know how I can access them from the java script code and how I can prevent the page from going to the server after pressing the submit button.

Apr 12th, 2007, 03:06 PM
You can validate several different ways. One easy way is with the use of patterns. Also, if you are validating credit card numbers, there are preset alogarithms I believe. I cannot remember the method names exactly but search google for pattern comparing/matching in javascript or credit card number validation in javascript...

Hope this helps.

Philip M
Apr 12th, 2007, 06:22 PM
It would help if you indicated exactly what it is you want to validate. Name? email? credit card number? or what?
If you decided to use the search facility on this forum using 'validate textbox ' or 'validate form' as your search terms you would find many examples. e.g.