Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / ColdFusion / Getting Started / July 2007



Tip: Looking for answers? Try searching our database.

CFFORM Required not working

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
sargent_slaughter - 03 Apr 2007 19:22 GMT
I have creatred a CFFORM and if I don't enter anything into any field it still
passes me on to the action form.  Have made many forms before and I am driving
myself crazy trying to see the difference why this one is not working.

<CFQUERY NAME="get_states" DATASOURCE="#DATASOURCE#">
    Select *
    FROM states
</CFQUERY>
<html>
<head>
<title>New User</title>
<link href="arial.css" rel="stylesheet" type="text/css" />

</head>

<body>
<CFFORM ACTION="newuser_insert.cfm" NAME="addUser" METHOD="POST">

  <table width="75%" border="0" cellpadding="5">
    <tr>
      <td width="23%">&nbsp;</td>
      <td width="35%">&nbsp;</td>
      <td width="42%">&nbsp;</td>
    </tr>
    <tr>
      <td>First Name </td>
      <td>
     
       <CFINPUT
        TYPE="Text"
        NAME="fname"
        SIZE="20"
        VALUE=""
        MAXLENGTH="100"
        REQUIRED="Yes"
        MESSAGE="Please type your first name.">
           
            </td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>Last Name </td>
      <td><CFINPUT
             name="lname"
            type="text"
            Value=""
            maxlength="30"
            REQUIRED="YES"
            SIZE="20"
            MESSAGE="Enter your last name"></td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>Address</td>
      <td><CFINPUT
             NAME="address1"
            TYPE="text"
            MAXLENGTH="30"  
            SIZE="20"
            VALUE=""
            REQUIRED="YES"
            MESSAGE="Enter your address"></td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>Address2</td>
      <td>
     <CFinput name="address2"
                 type="text"
                Value=""
                maxlength="30"></td>
      <td>Suite or Apartment # </td>
    </tr>
    <tr>
      <td>City</td>
      <td>
     <CFINPUT
             name="city"
            type="text"
            VALUE=""
            maxlength="30"
            REQUIRED="YES"
            SIZE="20"
            MESSAGE="Enter your city">
            </td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>State</td>
      <td>
     <Select Name="state">
        <OPTION></OPTION>
        <cfoutput query="get_states">
          <OPTION>#state#</OPTION>
        </cfoutput>
      </SELECT>
     </td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>Zip</td>
      <td>
     <CFINPUT
             name="zip"
            type="text"
            maxlength="30"
            VALIDATE="ZIPCODE"
            Message= "Entera valid Zip"
            SIZE="20">
            </td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>Area Code </td>
      <td>
     <CFinput name="areacode" type="text" value="" maxlength="30">
     </td>
      <td>(999)</td>
    </tr>
    <tr>
      <td>Phone</td>
      <td>
     <CFinput name="phone" type="text" value="" maxlength="30"></td>
      <td>999-9999</td>
    </tr>
    <tr>
      <td>e-mail</td>
      <td><CFINPUT
             name="phone"
            type="text"
            maxlength="50"
            VALUE=""
            VALIDATE="EMAIL"
            SIZE="20"
            REQUIRED="YES"
            MESSAGE ="Please enter a valid e-mail address"></td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>User Name </td>
      <td><CFINPUT
             name="username"
            type="text"
            maxlength="50"
            VALUE=""
            REQUIRED= "YES"
            SIZE="20"
            MESSAGE="Enter a username"></td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>Password</td>
      <td><CFINPUT
             name="pssword"
            type="password"
            maxlength="12"
            VALUE=""
            SIZE="20"
            REQUIRED="YES"
            MESSAGE="Enter a password"></td>
      <td>Min  6 Char Max 12 Char No Spaces </td>
    </tr>
    <tr>
      <td>Verify Password </td>
      <td><CFINPUT
             NAME="repssword"
            TYPE="password"
            VALUE=""
            MAXLENGTH="12"
            SIZE="20"
            REQUIRED="YES"
            MESSAGE="Re-enter your password"></td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>Question</td>
      <td><CFINPUT
             name="question"
            type="text"
            VALUE=""
            maxlength="150"
            SIZE="20"
            REQUIRED="YES"
            MESSAGE="Enter your Question"></td>
      <td>In Case You Have Forgotten Your Login </td>
    </tr>
    <tr>
      <td>Anwser</td>
      <td><CFINPUT
             name="anwser"
            type="text"
            maxlength="50"
            SIZE="20"
            REQUIRED="YES"
            MESSAGE="Enter your anwser"></td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>Interested In </td>
      <td><input type="radio" name="interests" value="learn more" />
        Learning More </td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td><input type="radio" name="interests" value="contact" />
        Being Contacted  </td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td><input type="radio" name="interests" value="qualify" />
        Qualified to Buy </td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td><input type="radio" name="interests" value="apply work" />
         Applying for Work </td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td><input type="radio" name="interests" value="apply to own" />
        Applying for Ownership </td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td><input type="radio" name="interests" value="advertising" />
        Advertising </td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td><input type="radio" name="interests" value="partnership" />
        Partnership </td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td colspan="3"><div align="CENTER">
     <INPUT type="hidden" value="visitor" name="rights">
        <input type="submit" Value="Submit">
        <input type="reset" value="Reset">
      </div></td>
    </tr>
  </table>
 
</CFFORM>
</body>
</html>
JoeNH2k - 03 Apr 2007 19:33 GMT
Do you know if your server has the cfform.js and masks.js files available to
your app? If not, the form checking will fail and move on to the next page. I
had this happen and wasn't able to access the web server to add the two .js
files. I copied them to my application script folder and linked them in my
header template. Not sure if that'll help you or not but it could be the issue.

<script language="JavaScript" type="text/javascript"  
src="scripts/cfform.js"></script>
<script language="JavaScript" type="text/javascript"
src="scripts/masks.js"></script>
sargent_slaughter - 04 Apr 2007 01:27 GMT
Solved.  I rewrote the code one field at a time testing it after each and now it works.  Thanks to everyone who looked to help
jackie_king2004 - 04 Apr 2007 03:36 GMT
<cfoutput><script>language="JavaScript"type="text/javascript"src="scripts/cfform.js"></script></cfoutput>
the similar problem has exprienced
blair_one - 31 Jul 2007 19:21 GMT
Just add a link to those files that are normally in the 'scripts' folder in
cfide in your page header.

Just like JoeNK2K said:
<script language="JavaScript" type="text/javascript"
src="scripts/cfform.js"></script>
<script language="JavaScript" type="text/javascript"
src="scripts/masks.js"></script>
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.