This works great!  Just one question... How do you compare two fields?

    }
if (form.pass1.value <>form.pass2.value) {
        alert( "Your passwords do not match." );
        form.pass1.focus();
        return false ;
    }

This does not work.

Casey



-----Original Message-----
From: Ingentus [mailto:ingentus@;eircom.net] 
Sent: Monday, October 28, 2002 11:05 AM
To: [EMAIL PROTECTED]
Subject: [wdvltalk] Re: Form Validation w/ JavaScript


Hi Casey,
Is this what you mean?

IN THE HEAD -

<script>
<!--
function checkData()
{
var correct = true
if (document.contactform.name.value == "") {correct = false;
alert("Please enter your name.")} if (document.contactform.email.value
== "") {correct = false; alert("Please enter your e-mail address.")}

if (correct){alert("Thank you for taking the time to fill out this
form.")} return correct } //--> </script>

FORM TAG -
 <form name="contactform" onSubmit="return checkData()" method="post"
action="cu_resp.asp">


----- Original Message -----
From: "Casey Crookston" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, October 28, 2002 4:32 PM
Subject: [wdvltalk] Form Validation w/ JavaScript


I've always done my form validation server side in ASP, but I'd like to
learn how it's done with JavaScript after hitting the submit button.

Any advice?

TIA,

Casey (the JavaScript illiterate developer)








____ * The WDVL Discussion List from WDVL.COM * ____
To Join wdvltalk, Send An Email To: mailto:wdvltalk-join@;lists.wdvl.com 
       Send Your Posts To: [EMAIL PROTECTED]
To change subscription settings to the wdvltalk digest version:
    http://wdvl.internet.com/WDVL/Forum/#sub

________________  http://www.wdvl.com  _______________________

You are currently subscribed to wdvltalk as:
[EMAIL PROTECTED] To unsubscribe send a blank email to
%%email.unsub%%

____ • The WDVL Discussion List from WDVL.COM • ____
To Join wdvltalk, Send An Email To: mailto:wdvltalk-join@;lists.wdvl.com
       Send Your Posts To: [EMAIL PROTECTED]
To change subscription settings to the wdvltalk digest version:
    http://wdvl.internet.com/WDVL/Forum/#sub

________________  http://www.wdvl.com  _______________________

You are currently subscribed to wdvltalk as: archive@jab.org
To unsubscribe send a blank email to [EMAIL PROTECTED]

Reply via email to