I will post the code for what I did.

dsp_login.cfm
<!---
|| Begin Fusedoc ||
|| Responsibilities ||
I display a login form for login into a secure or member area of a
website/application.  I have the ability to have a JavaScript quick
validation file to be included so that it saves time and frustration for the
user.  You can turn the template off by setting the json = "off".  by
Default I will have the template turned on and will include the file
js_logcheck.cfm.
|| History ||
Author: [EMAIL PROTECTED]
Version: 1.00
Date: 11/23/00
|| Attributes||
[json]: (on/off) (not required)
--->

<cfparam name="attributes.json" default="On">
<cfif (attributes.json is "ON") or (attributes.json is "On") or
(attributes.json is "on") >
        <cfinclude template="../JStmp/js_logcheck.cfm">
        <cfset json = "On">
</cfif>

<table border="0" cellspacing="0" cellpadding="0" frame="VOID" rules="NONE">
<form action="../index.cfm?fuseaction=isUser" method="post" <cfif json is
"On">onSubmit="return Vformer()"</cfif>>
        <tr>
                <td align="CENTER">
                        User Name:
                </td>
        </tr>
        <tr>
                <td align="CENTER">
                        <input type="Text" name="UserName" size="10" maxlength="10">
                </td>
        </tr>
        <tr>
                <td align="CENTER">
                        Password:
                </td>
        </tr>
        <tr>
                <td align="CENTER">
                        <input type="Password" name="Password" size="10" 
maxlength="10">
                </td>
        </tr>
        <tr>
                <td height="10">
                        &nbsp;
                </td>
        </tr>
        <tr>
                <td align="CENTER">
                        <input type="Submit" value="Enter">
                </td>
        </tr>
</form>
</table>

js_logcheck.cfm
<!---
|| Begin Fusedoc ||
|| Responsibilities ||
I check to see if a simple log in form has the UserName and Password fields
are not empty.
|| History ||
Author: [EMAIL PROTECTED]
Version: 1.00
Date: 11/23/00
|| Attributes ||
--->

<script language="JavaScript">
<!--
function Vformer ()
{
us=document.forms[0].UserName.value;
pw=document.forms[0].Password.value;
        if (us.length < 1)
        {
                alert("Please enter your User Name.");
                document.forms[0].UserName.focus();
                return false;
        }
        else
        {
                if (pw.length < 1)
                {
                        alert("Please enter your Password.");
                        document.forms[0].Password.focus();
                        return false;
                }
                else
                {
                return true;
                }
        }
}
-->
</script>

This way this form can be validated, and if I don't want the JavaScript to
validate the form, I don't need to worry bout having it included when it is
sent to the user by setting one variable to no:)

I developed this method with fusbox only because I am into heavy UI's for my
client side.  Server side development goes by so quick, I figured why not
spend sometime and research and get the UI to look presentable:)

Oh, and if you want more JavaScript validations:) Ask, and I will go through
my favorites and post what links I have:)

Hope this helps:)
Donald Pavlik

-----Original Message-----
From: ibtoad [mailto:[EMAIL PROTECTED]]
Sent: Saturday, November 25, 2000 10:29 AM
To: Fusebox
Subject: Form Help


How can I validate a form in Fusebox if  can't use <cfform>??

Thanks,
Rich
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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