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!

specify what a field will accept

Status
Not open for further replies.

LittleNFiesty

Technical User
Sep 26, 2006
46
US
I want to specify that a field only excepts numbers but it is not a "required field"

How do I do this?
 
You can do this with javascript to validate within the browser or you can do this with whatever scripting language your server supports (ASP/PHP/Perl/etc) to validate during form processing on the server.

There are specific forums here for javascript and server side languages. You'll get a more specific answer there once you decide which language you will be using to script this.

The key search phrase that might help you on your path at Google is 'form validation'
 
Just to add to this, personally I'm of the belief that you should do your validation on both the server and the client side. If you do the validation only with Javascript then you will not be able to stop them submitting something other than numbers if they have JS disabled.

Wullie

The pessimist complains about the wind. The optimist expects it to change. The leader adjusts the sails. - John Maxwell
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top