• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 268
  • Last Modified:

cfinput validate does not validate form fields?? -- CFMX 7 / MS Access database

Hi. Can someone help me out? I am following the rules to get cfinput to validate form fields. I set up the validation options on each required cfinput field, per Forta's CFMX7 book, but when I run the page, validation does not occur. I must be missing something, though I have followed the book carefully.

The page in question is located here: http://ebwebwork.com/ncpie-data/ncpie-update-contact.cfm

The server uses CF MX version 7. The database being queried is MS Access 2003.

My HTML / CFML markup looks like this:


             <CFSET date = Now()>
             <cfform method="POST" action="ncpie-update-done.cfm">
             <cfinput type="hidden" name="DateSubmitted" value="<CFOUTPUT>#DateFormat(date, 'mm dd yyyy')#</CFOUTPUT>">
               <table width="1000" border="0" cellspacing="0" cellpadding="4">
                     <tr>
                           <td width="50%" align="left" bgcolor="#dcdcdc">
                               <span style="font-family: verdana,arial,helvetica,sans-serif; color: #990033;">
<strong>Organization Name:</strong></span>*
                           </td>
                           <td width="50%" align="right" bgcolor="#dcdcdc"><em>(Please enter your organization's full name, rather than its acronym.)</em>
                               <cfinput type="text" name="orgName" size="40" required="yes" message="Please enter organization name.">
                           </td>
                     </tr>
                     <tr>
                           <td width="50%" align="left"><strong>Organization Name, Line 2:</strong>
                           </td>
                           <td width="50%" align="right">
                               <cfinput type="text" name="orgName2" size="40">
                           </td>
                     </tr>
                     <tr>
                           <td width="50%" align="left" bgcolor="#dcdcdc">
                               <span style="font-family: verdana,arial,helvetica,sans-serif; color: #990033;">
<strong>Street Address:</strong></span>*
                           </td>
                           <td width="50%" align="right" bgcolor="#dcdcdc">
                               <cfinput type="text" name="orgAddress" size="40" required="yes" message="Please enter street address.">
                           </td>
                     </tr>
                     <tr>
                           <td width="50%" align="left"><strong>Street Address, line 2, if needed:</strong>
                           </td>
                           <td width="50%" align="right">
                               <cfinput type="text" name="orgAddress2" size="40">
                           </td>
                     </tr>
                     <tr>
                           <td width="50%" align="left" bgcolor="#dcdcdc">
                               <span style="font-family: verdana,arial,helvetica,sans-serif; color: #990033;">
<strong>City:</strong></span>*
                           </td>
                           <td width="50%" align="right" bgcolor="#dcdcdc">
                               <cfinput type="text" name="orgCity" size="40" required="yes" message="Please enter City.">
                           </td>
                     </tr>
                     <tr>
                           <td width="50%" align="left">
                               <span style="font-family: verdana,arial,helvetica,sans-serif; color: #990033;">
<strong>State:</strong></span>*
                           </td>
                           <td width="50%" align="right">
                               <cfinput type="text" name="orgState" size="40" required="yes" message="Please enter State.">
                           </td>
                     </tr>
                     <tr>
                           <td width="50%" align="left" bgcolor="#dcdcdc">
                               <span style="font-family: verdana,arial,helvetica,sans-serif; color: #990033;">
<strong>ZIP:</strong></span>*
                           </td>
                           <td width="50%" align="right" bgcolor="#dcdcdc">
                               <cfinput type="text" name="orgZIP" size="40" required="yes" message="Please enter ZIP.">
                           </td>
                     </tr>
                     <tr>
                           <td width="50%" align="left">
                               <span style="font-family: verdana,arial,helvetica,sans-serif; color: #990033;">
<strong>Phone:</strong></span>*
                           </td>
                           <td width="50%" align="right">
                               <cfinput type="text" name="orgVoice" size="40" required="yes" message="Please enter Phone.">
                           </td>
                     </tr>
                     <tr>
                           <td width="50%" align="left" bgcolor="#dcdcdc">      TTY:
                           </td>
                           <td width="50%" align="right" bgcolor="#dcdcdc">
                               <cfinput type="text" name="orgTTY" size="40">
                           </td>
                     </tr>
                     <tr>
                           <td width="50%" align="left">
                               <span style="font-family: verdana,arial,helvetica,sans-serif; color: #990033;">
<strong>Fax:</strong></span>*
                           </td>
                           <td width="50%" align="right">
                               <cfinput type="text" name="orgFax" size="40" required="yes" message="Please enter Fax.">
                           </td>
                     </tr>
                     <tr>
                           <td width="50%" align="left" bgcolor="#dcdcdc">
                               <span style="font-family: verdana,arial,helvetica,sans-serif; color: #990033;">
<strong>Organization's general contact email:</strong></span>*
                           </td>
                           <td width="50%" align="right" bgcolor="#dcdcdc">
                               <cfinput type="text" name="orgEmail" size="40" required="yes" message="Please enter organization Email address.">
                           </td>
                     </tr>
                     <tr>
                           <td width="50%" align="left">
                               <span style="font-family: verdana,arial,helvetica,sans-serif; color: #990033;">
<strong>Web site URL (please omit http://):</strong></span>*
                           </td>
                           <td width="50%" align="right">
                               <cfinput type="text" name="orgURL" size="40" required="yes" message="Please enter organization web site URL.">
                           </td>
                     </tr>
                     <tr>
                           <td width="50%" align="left" bgcolor="#cccc99" style="padding:10px;border:1px solid #000;">
<p><strong>Organization description: (1-2 paragraphs) &#8212; <em>Hint: you can copy existing text and paste it into the text area to the right &#187;</em></strong></p>
                           </td>
                           <td width="50%" align="right">
                                 <textarea cols="60" rows="10" name="orgDescription"></textarea>
                           </td>
                     </tr>
                     <tr>
                           <td width="50%" align="left">
                               <span style="font-family: verdana,arial,helvetica,sans-serif; color: #990033;">
<strong>Contact person name, title:</strong></span>*
                           </td>
                           <td width="50%" align="right">
                               <cfinput type="text" name="orgContact" size="40" required="yes" message="Please enter Contact Name, Title.">
                           </td>
                     </tr>
                     <tr>
                           <td width="50%" align="left" bgcolor="#dcdcdc">
                               <span style="font-family: verdana,arial,helvetica,sans-serif; color: #990033;">
<strong>Contact person email:</strong></span>*
                           </td>
                           <td width="50%" align="right" bgcolor="#dcdcdc">
                               <cfinput type="text" name="orgContactEmail" size="40" required="yes" message="Please enter Contact Person Email.">
                           </td>
                     </tr>
                     <tr>
                           <td width="50%" align="left">
                               <span style="font-family: verdana,arial,helvetica,sans-serif; color: #990033;">
<strong>Director name, title:</strong></span>*
                           </td>
                           <td width="50%" align="right">
                               <cfinput type="text" name="orgDirector1" size="40" required="yes" message="Please enter Director Name, Title.">
                           </td>
                     </tr>
                     <tr>
                           <td width="50%" align="left" bgcolor="#dcdcdc">      Director Email:
                           </td>
                           <td width="50%" align="right" bgcolor="#dcdcdc">
                               <cfinput type="text" name="orgDirector1Email" size="40">
                           </td>
                     </tr>
                     <tr>
                           <td width="50%" align="left">      Co-Director or other staff name, title:
                           </td>
                           <td width="50%" align="right">
                               <cfinput type="text" name="orgDirector2" size="40">
                           </td>
                     </tr>
                     <tr>
                           <td width="50%" align="left" bgcolor="#dcdcdc">      Co-Director Email:
                           </td>
                           <td width="50%" align="right" bgcolor="#dcdcdc">
                               <cfinput type="text" name="orgDirector2Email" size="40">
                           </td>
                     </tr>
               </table>
               <div style="text-align:center;">
                   <cfinput type="submit" name="submit" value="Send to NCPIE" class="btn">
               </div></cfform>

Very grateful for any ideas. Thanks.

(I would like to use cfinput validation, rather than a javascript to validate form fields -- the former just seems more elegant to me.)

Eric Bourland
0
Eric Bourland
Asked:
Eric Bourland
  • 2
1 Solution
 
rragledavisCommented:
I could be missing something but it looks as though the only thing you are checking against is whether the field has data or not? That part seems to be working for me. Were you looking for more specific validation? That is possible - far more robust in MX7 than previous versions. What form are you running?
0
 
Eric BourlandAuthor Commented:
Hi, rragledavis , thanks for the reply. After doing a lot of research on this topic I decided to jettison cfinput validation, and use a simple validation javascript instead. It's working now, using the javascript. I have read up on form validation in CFMX7 -- yeah, it's robust -- when it works. ;-) I am sure it does work, and maybe there's some quirk in my markup that sabotaged the cfinput validation before. In any case -- thanks again for your help. I am gonna close the question. All best. Eric Bourland
0
 
Eric BourlandAuthor Commented:
mrichmon, thanks for this. I thought I had closed this question and accepted the answer? Hmmm.
0
 
GranModCommented:
PAQed with points refunded (200)

GranMod
Community Support Moderator
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now