This will do what you want. IE 4+, Mozilla 5+ , NS6, and Opera only. The
only thing that wont work in N4 is the color of the input field. Just
because the old Netscape doesn't support css very well.

<script>
    function validate() {
        if (document.myForm.textfield.value == '') {
            alert("Fill in your password dummy");
            myForm.textfield.style.background = 'red';
            myForm.textfield.focus();
   return false;
        }
}
</script>


<form name="myForm" method="post" onsubmit="return validate();">
<input type="Text" name="textfield" style="">
<input type="Submit" name="submit" value="submit">
</form>


jon
----- Original Message -----
From: "Angél Stewart" <[EMAIL PROTECTED]>
To: "CF-Community" <[EMAIL PROTECTED]>
Sent: Thursday, May 17, 2001 2:32 PM
Subject: Full featured Registration form..


> Has anyone created a form that does:
>
> Validation, where the formfield labels turn red when a field is null?
> Or where it posts a message if the password and password verify fields do
> not match?
>
> I'm doing it myself but it is quite tedious..and I'm doing it with CFIF
> statements.
> Is there an easier way?
> ^_^
>
> -Gel
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-community@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to