Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

cfform not validating required fields.

Posted on 2007-03-21
7
Medium Priority
?
983 Views
Last Modified: 2008-01-09
I am using <cfform> and have certain fields that are required using <cfinput>. The require fields prompt is not coming up and I am getting errors when I submit the form. I have the cfform.js file on the server and have mapped to it correctly. I also tried adding scriptSrc="/includes/cfform.js" to the opening <cfform> and the result was the same. The form is located at http://strategicequityreport.com/debt-equity-goals-survey.cfm. It is the large form, not the little on on the side.

I have the following in the head tag:

<script type="text/javascript" src="/includes/cfform.js"></script>

A snippet of the form is:

 <cfform name="survey" action="/survey2.cfm" method="post">
 <cfinput type="text" name="EmailAddress" size="30" message="Please enter an email address" validate="email" required="yes">
<cfinput type="submit" name="Submit" value="Submit" />
</cfform>

0
Comment
Question by:semerj
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
7 Comments
 
LVL 36

Expert Comment

by:SidFishes
ID: 18768500
I never use cfform but...

the js code is erroring on

if (obj.value.length == 0)

which means the js is running..there's just a problem

so there's something with your cfform can't say for sure given the code you've posted but looks like you're not validating some thing or have something misnamed maybe??

0
 

Author Comment

by:semerj
ID: 18774715
Actually, I think that error is stemming from the emailaddress field being left blank and going through to the action page. The <cfmail> has a null attribute for the from address because the js did not catch it on the previous page.  If the js were running, it would not get to that point.
0
 
LVL 36

Expert Comment

by:SidFishes
ID: 18776543
no ..the js on that page IS running ...I've set firebug to break on JS errors and it does error on the page before the submit....using this debug method, i don't even get to the form submit...if i run after the break then I get the cf error

something else is going on...

0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

Author Comment

by:semerj
ID: 18777390
ok. I see that now on line 62 of the Js file. Shall I paste the entire form code? It is kinda long.
0
 

Author Comment

by:semerj
ID: 18779251
upon further investigation, forms on my server that were validation just fine using the cfform.js are not anymore.
0
 
LVL 4

Accepted Solution

by:
mackaboogie earned 2000 total points
ID: 18781502
Your devnet version of CF is placing invalid JS src links in your code.
<script type="text/javascript" src="C:\Inetpub\vhosts\aidcdemos.com\httpdocs\CFIDE\scripts/cfform.js"></script>
<script type="text/javascript" src="C:\Inetpub\vhosts\aidcdemos.com\httpdocs\CFIDE\scripts/masks.js"></script>

These should read:
<script type="text/javascript" src="/CFIDE/scripts/cfform.js"></script>
<script type="text/javascript" src="/CFIDE/scripts/masks.js"></script>

You need to remove the additional link you placed to cfform.js higher up the page as well.
0
 

Author Comment

by:semerj
ID: 18788094
I am in the process of migrating everything to a new server and will try this as soon as it is set up.
0

Featured Post

Tech or Treat! - Giveaway

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Shoutout to Emily Plummer (http://www.experts-exchange.com/members/eplummer26.html) for giving me this article! She did most of it, I just finished it up and posted it for her :)    Introduction In a previous article (http://www.experts-exchang…
Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question