> Is it possible to mix html form fields and <cfinput> fields 
> in a page and use JavaScript to validate the html form fields 
> while still using <cfform> validation for <cfinput> fields?

You can certainly do this. Here's an example:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>
<head>
        <title>Additional Validation</title>

<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
<!--

function validateme(myform) {
        alert(myform.name);
        if (myform.mytextarea.value == '') {
                alert('textarea is empty!');
                return false;
        } else {
                return true;
        }
}

//-->
</SCRIPT>       

</head>

<body>

<cfform action="foo.cfm" onsubmit="return validateme(this);">

<textarea name="mytextarea"></textarea>

<br>

<input type="submit">

</cfform>

</body>
</html>

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
fax: (202) 797-5444

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to