Validat.js error

On a page I am using the jQuery plugin validate.js.  There is a peculiar issue happening.  If you go to this page: http://23.101.151.179/index.php/store/29  fill out the first form click submit and more info shows up.  Do fill in anything and go to the bottom of the page and click the submit button.  The validate errors show up.  now, just click in random fields and the error will begin to duplicate.  I also have a onChange function on this page.  Is there a solution to why this is doing this?
LVL 7
rgranlundAsked:
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.

Ray PaseurCommented:
Make a Google search for Chrome Dev Tools, install Chrome and the Dev Tools, and open the Developer Console to Elements.  Then visit the URL.  You will be able to see the errors occurring in real time.  There are syntax errors and 404 responses from the web services.

Just a note - I could not do my job at all without the Chrome Dev Tools.  Once you use them, even a little bit, you will be delighted.
0
rgranlundAuthor Commented:
Thanks!  Great tool.  I always use FF but I can see the advantages here.  However, I don't see where the syntax error is.  Do I need to add more to the developer plugin?
0
Ray PaseurCommented:
I don't use FF for these things, but I can show you a screen capture that uses the Dev Tools.  These errors are noted on the initial load - I have not activated any controls on the page.Screen  Capture with Chrome Dev Tools
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

rgranlundAuthor Commented:
When I load mine I do not get the Uncaught Syntax Error.  Maybe there are a few settings I do not have turned on?
0
Ray PaseurCommented:
Try doing "view source" to see the generated HTML.  When I do it, I see things like this:

<h4>A PHP Error was encountered</h4>

<p>Severity: Notice</p>
<p>Message:  Undefined variable: liability_25</p>
<p>Filename: libraries/Functions.php(688) : eval()'d code</p>
<p>Line Number: 424</p>

</div>";
        		 }	else if (liability_option_value == "liability_50" )   {
        		 		liability_rate = "<div style="border:1px solid #990000;padding-left:20px;margin:0 0 10px 0;">

<h4>A PHP Error was encountered</h4>

<p>Severity: Notice</p>
<p>Message:  Undefined variable: liability_50</p>
<p>Filename: libraries/Functions.php(688) : eval()'d code</p>
<p>Line Number: 426</p>

</div>";
        		 }	else if (liability_option_value == "liability_100" )   {
        		 		liability_rate = "<div style="border:1px solid #990000;padding-left:20px;margin:0 0 10px 0;">

<h4>A PHP Error was encountered</h4>

<p>Severity: Notice</p>
<p>Message:  Undefined variable: liability_100</p>
<p>Filename: libraries/Functions.php(688) : eval()'d code</p>
<p>Line Number: 428</p>

</div>";

Open in new window

0
Ray PaseurCommented:
I'm not logged in or otherwise accepting cookies from this site, so it may be that I see the "initial state" every time without the PHP session.  There could be a lot of variability between your view and mine.  But in any case, it looks like the PHP script is belching errors into the HTML stream and the "view" is not showing these errors.
0
rgranlundAuthor Commented:
I cleaned up all of those errors but it is still happening.  I use the same script on another page and it does not do that.  All I can figure is that the form it is validating also has another function connected to it that is onChange.  Stuck I guess.
0
Tom BeckCommented:
As I pointed out for you already, it's the double quotes in all of these javascript lines that have to be fixed.

liability_rate = "<div style="border:1px solid #990000;padding-left:20px;margin:0 0 10px 0;"></div>";

Put single quotes at the end of the strings. Fourteen instances by my last count.

liability_rate = '<div style="border:1px solid #990000;padding-left:20px;margin:0 0 10px 0;"></div>';
0
rgranlundAuthor Commented:
I fixed that error and it still happens.  Those quote marks are in a different piece of javascript and not the piece that is causing it to double the error message..  The code that is: /js/validate_cart.js , it is in the head.
0
Tom BeckCommented:
Looks much better without the errors. Thanks. Now we have something deserving of further inspection.

Two Problems:

1.) There is something wrong with the validate.js file that you are loading with this block:
<script src="http://23.101.151.179/index.php?/js/validate" type="text/javascript"></script>

2.) You are loading it twice. If you look at the source using Firefox, it is loading on line 20 and again on line 136.

The validate.js file you are loading says it's version 1.13.0. When I substitute a fresh copy, which happens to be version 1.13.1, and eliminate the second instance, the problem goes away.
0

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
rgranlundAuthor Commented:
A new version of the script!?  I never would have thought of that.  Thank you for your time and pointing that out.  I have been a little behind the 8 ball figuring this out.
0
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
jQuery

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.