Solved

Coldfusion 8 required field does not work

Posted on 2009-07-11
7
370 Views
Last Modified: 2013-12-16
I have a required field which is not working.  Per this thread

http://www.experts-exchange.com/Web_Development/Software/Macromedia_Dreamweaver/Q_22834971.html

Even though I was able to browse to the /cfide/scripts folder, I copied the cfide folder into my site root and added scriptSrc="/CFIDE/cfform.js" to the cfform tag and still no go.  There is also a mapping to the cfide folder in the cf8 admin panel.

It fails in both ie7 and FF. Details:

Form tag:
    <cfform method="post" id="form1" action="#cgi.SCRIPT_NAME#?client_id=#url.client_id#&action=#url.action#" preservedata="yes" scriptSrc="/CFIDE/cfform.js">

Field tag:
<cfinput type="text" name="client_company" id="client_company" value="#c.client_company#" size="80" maxlength="100" required="yes"  message="Please enter the Client company name." />

Viewing page source, among everythingthere, I see:

<script type="text/javascript" src="/CFIDE/cfform.js"></script>
<script type="text/javascript" src="/CFIDE/masks.js"></script>
<script type="text/javascript">
      if (window.ColdFusion) ColdFusion.required['client_company']=true;
</script>
        //form element client_company required check
        if( !_CF_hasValue(_CF_this['client_company'], "TEXT", false ) )
        {
            _CF_onError(_CF_this, "client_company", _CF_this['client_company'].value, "Please enter the Client company name.");
            _CF_error_exists = true;
        }

It SEEMS like everything is correct.  

Ideas anyone?
0
Comment
Question by:Richard__G
  • 4
  • 3
7 Comments
 
LVL 52

Expert Comment

by:_agx_
ID: 24835701
> I copied the cfide folder into my site root and added scriptSrc="/CFIDE/cfform.js"
> to the cfform tag

If you copied the whole CFIDE folder, then wouldn't the files still be located in:

      /CFIDE/Scripts/cfform.js
      ... etc...

And not

       /CFIDE/cfform.js
0
 

Author Comment

by:Richard__G
ID: 24886620
Sorry, yes.  I changed it to /CFIDE/Scripts/cfform.js and still have the same problem.
0
 
LVL 52

Expert Comment

by:_agx_
ID: 24886751
I agree the settings seem correct, but obviously not ;-)  About 95% of the time the problem is one of three things:

1) A problem with the /CFIDE mapping. The mapping should be from the _root_ of your site. (If you are using IIS you may need to create a virtual mapping)
2) The files are not where you think they are (ie you are using the wrong path or they were copied to a different location)
3) The js files do not actually exist in that folder. Check the physical files and paths

You should be able to view the javascript files directly from your browser:

         http://yoursite.com/CFIDE/Scripts/cfform.js

If you receive an http 404 error then check the 3 things above
http://kb2.adobe.com/cps/186/tn_18653.html

> I changed it to /CFIDE/Scripts/cfform.js

Though either way should work, if the files are in the default location /CFIDE/Scripts/*, you do not have to  use "scriptSrc".  Note the "/" means from the root of your site.  
0
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 

Author Comment

by:Richard__G
ID: 24887409
I really appreciate your help, thanks!

Guess what... my fault.

I finally focused on the fact that this is the only form misbehaving and just kept removing elelments.  Turns out I had a field with an ID DIFFERENT from its  field name. Once I matched them up, bingo. It worked.  Argggg.

So how do points work in this situation? Please reply with the above solution so I can give you some!



0
 
LVL 52

Expert Comment

by:_agx_
ID: 24888061
Well there are some general guidelines for when an expert solves the problem for you. But you solved your own problem ;-)  So in my opinion this one is entirely up to you.  I would be okay with anything you decide (including PAQ'ing and requesting a point refund).
0
 

Accepted Solution

by:
Richard__G earned 0 total points
ID: 24889421
Heck - they're yours for trying to help, it kept me focused.  Can you include the below in a reply and I'll award them to that?  Thanks again!

I agree the settings seem correct, but obviously not ;-)  About 95% of the time the problem is one of three things:

1) A problem with the /CFIDE mapping. The mapping should be from the _root_ of your site. (If you are using IIS you may need to create a virtual mapping)
2) The files are not where you think they are (ie you are using the wrong path or they were copied to a different location)
3) The js files do not actually exist in that folder. Check the physical files and paths

You should be able to view the javascript files directly from your browser:

         http://yoursite.com/CFIDE/Scripts/cfform.js

If you receive an http 404 error then check the 3 things above
http://kb2.adobe.com/cps/186/tn_18653.html

> I changed it to /CFIDE/Scripts/cfform.js

Though either way should work, if the files are in the default location /CFIDE/Scripts/*, you do not have to  use "scriptSrc".  Note the "/" means from the root of your site.  
---------------------------------------------------------------------------------------------
Guess what... my fault.

I finally focused on the fact that this is the only form misbehaving and just kept removing elelments.  Turns out I had a field with an ID DIFFERENT from its  field name. Once I matched them up, bingo. It worked.  Argggg.

So how do points work in this situation? Please reply with the above solution so I can give you some!
0
 
LVL 52

Assisted Solution

by:_agx_
_agx_ earned 200 total points
ID: 24893287
Didn't I already post that above?  ;-)  ( I do not use the "ask a question" feature much, so I have very little experience with the closing a question options )
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Serif Plus workable? 4 44
replace tables with divs, using templates(bootstrap) 9 277
wysiwyg - good free programs 3 61
Problem to event 1 673
This article provides a case study on how our local youth baseball league deployed a new website, including the platform selection, implementation and benefits to the league.
When setting up new project requests for our site, one of the most powerful tools our team has available to use is Axure (http://www.axure.com/). It’s a tool for creating software and web prototypes that can function and interact as if it were the a…
The purpose of this video is to demonstrate how to Import and export files in WordPress. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Click on Too…
The purpose of this video is to demonstrate how to set up an RSS Feed on a WordPress Website. This will be demonstrated using a Windows 8 PC. Feedburner will be used for this demonstration. Go to your WordPress login page. This will look like the…

708 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now