Solved

Coldfusion 8 required field does not work

Posted on 2009-07-11
7
374 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
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 

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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Now that Expression Web 4.0 (http://www.microsoft.com/expression/products/Upgrade.aspx) is free if you buy or have the full version of Expression Web 3.0, now is the best time to  migrate from FrontPage to Expression Web (http://www.frontpage-to-exp…
Turn A Profile Picture Into A Cartoon Using Photoshop And Illustrator This tutorial will teach you how to make a cartoon style image out of a regular picture. I have tried to keep the tutorial as simple as possible. I used Adobe CS4 for this tuto…
The purpose of this video is to demonstrate how to manually back up a WordPress Database. This will be demonstrated using a Windows 8 PC. The Host used will be IPage.com Log into your Hosting account. IPage will be used for demonstration : Locat…
The purpose of this video is to demonstrate how to Test the speed of a WordPress Website. Site Speed is an important metric of a site’s health. Slow site speed can result in viewers leaving your site quickly and not seeing your content. This…

820 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