Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CFINPUT validation order

Status
Not open for further replies.

yoshismokey

Programmer
Sep 17, 2005
25
US
I have a CFFORM with CFINPUT statements containing validate for zip, phone, etc. When I run the code, the order of validation is random and jumps all over the place. Is there any way to fix this?

Here is the code:

<cfform name="addagency" action="AddAgency1.cfm" method="post">
<tr>
<cfif IsDefined('form.agency_name')>
<td class="FormTitleFieldName"> <div align="left">Agency Name:</div></td>
<td><input type="text" name="Agency_Name" value=<cfoutput>"#Agency_Name#"</cfoutput> maxlength="50" size="50"></td>
<cfelseif NOT IsDefined('form.agency_name')>
<td class="FormTitleFieldName"> <div align="left">Agency Name:</div></td>
<td><cfinput type="text" name="Agency_Name" required="yes" message="You must enter an agency name" maxlength="50" size="50"></td>
</cfif>
</tr>
<tr>
<td class="FormTitleFieldName"> <div align="left">
<p class="FormTitleFieldName">Address 1:</p>
</div></td>
<td><cfinput type="text" name="Address1" required="yes" message="You must enter an address" maxlength="50" size="50"></td>
</tr>
<tr>
<td class="FormTitleFieldName"> <div align="left">Address 2:</div></td>
<td><cfinput type="text" name="Address2" maxlength="50" size="50"></td>
</tr>
<tr>
<td class="FormTitleFieldName"> <div align="left">City:</div></td>
<td><cfinput type="text" name="City" required="Yes" message="You must enter a city" maxlength="20" size="20"></td>
</tr>
<tr>
<td class="FormTitleFieldName"> <div align="left">State:</div></td>
<td><cfinput type="text" name="State" required="yes" message="You must enter a state"maxlength="20" size="20"></td>
</tr>
<tr>
<td class="FormTitleFieldName"> <div align="left">Zip Code:</div></td>
<td><cfinput type="text" name="Zip" maxlength="10" size="20" required="Yes" validate="zipcode" message="You must enter a valid Zip Code"></td>
</tr>
<tr>
<td class="FormTitleFieldName"> <div align="left">Contact:</div></td>
<td><cfinput type="text" required="yes" message="You must enter a Contact name" name="Contact" maxlength="20" size="20"></td>
</tr>
<tr>
<td class="FormTitleFieldName"> <div align="left">Phone:</div></td>
<td><cfinput type="text" name="Phone" required="yes" validate="telephone" message="You must enter a valid phone number" maxlength="12" size="12"></td>
</tr>
<tr>
<td class="FormTitleFieldName"> <div align="left">Email:</div></td>
<td><cfinput type="text" name="Email" required="yes" message="You must enter an email address" maxlength="20" size="20"></td>
</tr>
<tr>
<td class="FormTitleFieldName"> <div align="left">Login:</div></td>
<td><cfinput type="text" name="Login" required="yes" maxlength="12" size="12"></td>
</tr>
<br>
<tr>

<td height="40" colspan="2"> <div align="center">
<input name="submit" type="submit" value="Add Agency">
</div></td>
</tr>
</cfform>

Thanks,
Robin
 
If I don't enter any fields at all and submit the form, it always starts with Zip, then city, state, agency, phone #, login, email, addresss, then contact name. If there is an agency name typed in, it starts with phone, then zip, amail, etc. It doesn't seem to be alphabetical.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top