Coldfusion client side FORM validation not working

For the life of me I can't figure out why my CF client side form validation isn't working.  With the attached script, no error messages pop up if the form is submitted without data.  What am I doing wrong???
<cfform action="test.cfm">
First Name: 
<cfinput name="firstname" type="text" maxlength="70" required="yes" message="Please Enter your First Name" validateAt="onSubmit"/><br />
Last Name:
<cfinput name="lastname" type="text" maxlength="70" required="yes" message="Please Enter your Last Name" validateAt="onSubmit"/><br />
<cfinput type="submit" name="Submit" value="Submit" />

Open in new window

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

A common cause is that the cfform.js file cannot be found in the expected location.  CF uses javascript files to perform validation.  If the files do not exist in the expected location

.. the validation will not work.  Try the above url. Replace with your root website address.  If you get an HTTP 404 error (file not found) that is your problem.

Per an adobe technote there are (3) ways to solve this problem:

1) Put a copy of the cfform.js file into a directory in your webroot and use the scriptSrc attribute of thecfform tag to reference it.


2) Create a virtual directory within your website configuration to point to the /CFIDE/scripts directory under the default website.

3)  Copy the /CFIDE/scripts directory into the webroot of the new site.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
slick_moeAuthor Commented:
I tried locating the cfform.js file like you specified ( - with my URL instead - and I did get the 404 error.

But, to complicate things, I just noticed that the client side validation DOES work in firefox, but not in IE7.  Seems that if firefox is finding the .js IE7 would to.  What do you think?
I don't see how it could work at all the file does not exist.  Check the url I typed, make sure there are no typos.  

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

> at all the file does not exist.

... at all IF the file does not exist.
I tested the code and it works for me with IE 6 and firefox.  That suggests to me either a problem with missing files or a problem with IE7.  I lean towards missing files simply because that is most common problem.  But I suppose it could be a problem with IE 7.

slick_moeAuthor Commented:
Well, I created a virtual directory to CFIDE as you specified above and it solved the problem in IE7.  Problem solved, but it's still strange to me the FF worked without the virtual directory.  I guess I'll just be content knowing that it works now.

Excellent help, thanks!!!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Servers

From novice to tech pro — start learning today.