[Javascript] validating a form using Javascript

Peter-Paul Koch gassinaumasis at hotmail.com
Wed Jan 22 10:58:01 CST 2003


>I need your help again! Someone always has a solution to my problem so I 
>have my fingers crossed!
>
>I am using ColdFusion to input data into an Access database.
>My instructions are to include:
>
>A default value of "-2" in all fields and then performs an edit check
>for that "-2" to force the user to replace the "-2".
>
>Validate all addition used on the form.
>
>I wrote a JavaScript function that checks for "-2" when the form is
>submitted and gives the user a message to change the incorrect field.
>It then checks the addition on the form.  I thought it was working fine
>but found problems during testing.

>   if (document.openp5.cexptot.value =="-2") {

if (document.openp5.cexptot.value,indexOf('-2') != -1 ) {

I don't know Cold Fusion so I can't help you with your other question.

--------------------------------------------------
ppk, freelance web developer
Interaction, copywriting, JavaScript, integration
http://www.xs4all.nl/~ppk/
Column "Keep it Simple": http://www.digital-web.com/columns/keepitsimple/
--------------------------------------------------


_________________________________________________________________
The new MSN 8: smart spam protection and 2 months FREE*  
http://join.msn.com/?page=features/junkmail




More information about the Javascript mailing list