form validation javascript inside ASP ?

M

megabyte

Hello;

I have an ASP application which gathers information to put in a
database via some forms - I would like to do the form validation
(making sure some fields are not empty) with a Javascript script inside
the ASP file - what is the syntax for doing this? Usually I would place
the javascript inside the <head> tags, but ASP files don't have
those...

Thanks for any help.

Eric.
 
M

Mark Schupp

If you want the validation done on the client side you would include the
script in the html output (inside the <head> tags if you like).

If you want server-side validation (and you should always do it server-side
in addition to any client-side validation) then put the code where ever you
need it if you are using jscript in the ASP page. If you are using VBScript
in the page then you probably want to use VBScript for the server-side
validation as well.
 
B

Bullschmidt

Some JavaScript validation links (and they work fine on ASP pages just
as they do on regular HTML pages):

Javascript Field Validations -- Client Side Scripting by Nannette
Thacker - 8/19/1999
http://www.shiningstar.net/articles/articles/javascript/javascriptvalida
tions.asp?ID=AW

Form Validation Using Javascript - 9/19/1998
http://www.4guysfromrolla.com/webtech/091998-1.shtml
Good tips such as saving JavaScript functions in a file called
DataValidation.js and including this in pages that need this.
JavaScript functions.

WebDaily: Your daily source for Web Technology Tips and Tricks! -
10/27/1998
http://www.4guysfromrolla.com/webtech/102798-1.shtml
Just checks if fields filled in.

Best regards,
J. Paul Schmidt, Freelance Web and Database Developer
http://www.Bullschmidt.com
Access Database Sample, Web Database Sample, ASP Design Tips

<<
I have an ASP application which gathers information to put in a database
via some forms - I would like to do the form validation (making sure
some fields are not empty) with a Javascript script inside the ASP file
- what is the syntax for doing this? Usually I would place the
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top