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

x
?
Solved

Coldfusion 8 required field does not work

Posted on 2009-07-11
7
Medium Priority
?
378 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
Plesk WordPress Toolkit

Plesk's WordPress Toolkit allows server administrators, resellers and customers to manage their WordPress instances, enabling a variety of development workflows for WordPress admins of all skill levels, from beginners to pros.

See why 2/3 of Plesk servers use it.

 

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 800 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

Understanding Web Applications

Without even knowing it, most of us are using web applications on a daily basis. Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We often confuse these web applications tools for websites.  So, what is the difference?

Question has a verified solution.

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

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…
Originally, this post was published on Monitis Blog, you can check it here . It goes without saying that technology has transformed society and the very nature of how we live, work, and communicate in ways that would’ve been incomprehensible 5 ye…
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…
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…

610 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