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%"> </td>
<td width="35%"> </td>
<td width="42%"> </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> </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> </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> </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> </td>
</tr>
<tr>
<td>State</td>
<td>
<Select Name="state">
<OPTION></OPTION>
<cfoutput query="get_states">
<OPTION>#state#</OPTION>
</cfoutput>
</SELECT>
</td>
<td> </td>
</tr>
<tr>
<td>Zip</td>
<td>
<CFINPUT
name="zip"
type="text"
maxlength="30"
VALIDATE="ZIPCODE"
Message= "Entera valid Zip"
SIZE="20">
</td>
<td> </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> </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> </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> </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> </td>
</tr>
<tr>
<td>Interested In </td>
<td><input type="radio" name="interests" value="learn more" />
Learning More </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td><input type="radio" name="interests" value="contact" />
Being Contacted </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td><input type="radio" name="interests" value="qualify" />
Qualified to Buy </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td><input type="radio" name="interests" value="apply work" />
Applying for Work </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td><input type="radio" name="interests" value="apply to own" />
Applying for Ownership </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td><input type="radio" name="interests" value="advertising" />
Advertising </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td><input type="radio" name="interests" value="partnership" />
Partnership </td>
<td> </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>