Question
Data Validation
I have a form (below) that uses the <cfform> tags with
the "required" attributes to validate that the user has entered
info and not left a required field blank. This form works correctly
on my local machine. For example, if I leave all the fields blank
and click the register button I get a JS popup prompting the user
to provide the required data. Now, when I put this file to the
Register.com server which is using the same version of
coldfusion(which is activated) as my local machine the data
validation part is not functioning and the user is sent directly to
the thank you for registering page regardless of whether he puts
any of the fields in, other than the password fields because they
are forced to match via <cfif><cfelseif> statements. I
spoke with Register.com and they claim it is a coding issue even
though it works great locally. Anyone have a suggestion, does
Register.com not have a JS plugin enabled?
Thanks in advance!
<cfform method="post" name="form1" action="#CGI.SCRIPT_NAME#" >
<table align="center">
<tr valign="baseline">
<td nowrap align="right">First Name:</td>
<td>
<cfinput type="text" name="firstName"
value="#FORM.firstName#"required="yes"
message="You must enter a first name!"
size="32">
</td>
</tr>
<tr valign="baseline">
<td nowrap align="right">Last Name:</td>
<td>
<cfinput type="text" name="lastName"
value="#FORM.lastName#" required="yes"
message="You must enter a last name!"size="32">
</td>
</tr>
<tr valign="baseline">
<td nowrap align="right">Email Address:</td>
<td>
<cfinput type="text" name="email"
value="#FORM.email#"required="yes"
message="You must enter an email address!" size="32">
</td>
</tr>
<tr valign="baseline">
<td nowrap align="right">Password:</td>
<td>
<cfinput type="password" name="password" value="" size="32">
</td>
</tr>
<tr valign="baseline">
<td nowrap align="right">Confirm Password:</td>
<td>
<cfinput type="password" name="password2" value="" size="32">
</td>
</tr>
<tr valign="baseline">
<td nowrap align="right"> </td>
<td><input type="submit" value="Register"></td>
</tr>
</table>
<input type="hidden" name="MM_InsertRecord" value="form1">
</cfform>
Thanks in advance!
<cfform method="post" name="form1" action="#CGI.SCRIPT_NAME#" >
<table align="center">
<tr valign="baseline">
<td nowrap align="right">First Name:</td>
<td>
<cfinput type="text" name="firstName"
value="#FORM.firstName#"required="yes"
message="You must enter a first name!"
size="32">
</td>
</tr>
<tr valign="baseline">
<td nowrap align="right">Last Name:</td>
<td>
<cfinput type="text" name="lastName"
value="#FORM.lastName#" required="yes"
message="You must enter a last name!"size="32">
</td>
</tr>
<tr valign="baseline">
<td nowrap align="right">Email Address:</td>
<td>
<cfinput type="text" name="email"
value="#FORM.email#"required="yes"
message="You must enter an email address!" size="32">
</td>
</tr>
<tr valign="baseline">
<td nowrap align="right">Password:</td>
<td>
<cfinput type="password" name="password" value="" size="32">
</td>
</tr>
<tr valign="baseline">
<td nowrap align="right">Confirm Password:</td>
<td>
<cfinput type="password" name="password2" value="" size="32">
</td>
</tr>
<tr valign="baseline">
<td nowrap align="right"> </td>
<td><input type="submit" value="Register"></td>
</tr>
</table>
<input type="hidden" name="MM_InsertRecord" value="form1">
</cfform>