View Full Version : Form Field Checking
rainman
07-17-2004, 05:35 AM
Can anyone help ... I need to know how to check a field in a form. I would like to check information such as numbers, dates, email etc. I am using jmail
stophon4
07-17-2004, 09:52 PM
You can use Javascript or a Server side language (php, perl, asp, cgi, etc.).
If you do not need anything very secure, javascript will work just fine, it is also the easiest to learn, before you ask how search google for tutorials.
Roy Sinclair
07-19-2004, 09:26 PM
If it's automatically input into a database (as opposed to being emailed to someone) then your first and foremost checking should be done on the server since users can always disable javascript and then enter anything they like into your fields. Once you've got the server side taken care of (so you can be sure your data will contain reasonable values) you can then add Javascript on the client side to assist the user in filling out the form properly the first time it's submitted instead of having to run back and forth to the server to correct every problem on the page.
In short: Server side check in there to prevent bad data from entering your database and to cover the user with javascript disabled while the client side javascript is there to help the user fill out the form more easily and more accurately in the first place. Both are useful, each in their own way.
Big Fat
07-23-2004, 11:44 PM
The javascript I've seen will validate email address format and prevent you from getting stuff you don't want like obscenities. You can find cut and paste javascript you can use - maybe a little editing in the validation part, not the javacript itself. Go to Google and type javascript.
Good hunting.
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.