Solved

Coldfusion 8 required field does not work

Posted on 2009-07-11
7
375 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
[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
  • 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
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 

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: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

Suggested Solutions

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.
Objective of This Article In 1990’s, when I was a budding software professional, I had a lot of confusion about which stream or technology, I had to choose to build my career. In those days, I had lot of confusion like whether to choose System so…
The purpose of this video is to demonstrate how to set up basic WordPress SEO. This will be demonstrated using a Windows 8 PC. The plugin used will be WordPress SEO by Yoast. Go to your WordPress login page. This will look like the following: myw…
The purpose of this video is to demonstrate how to set up the permalinks on a WordPress Website. 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 : Go t…

734 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