Forums

javascript cause validation error

bveljkovic 18 Apr, 2011
It looks like javascript cause page not to pass validation. here is a link:http://validator.w3.org/check?uri=http%3A%2F%2Fwww.affordablelaundry.com%2Flaundry-service-request-form&charset=%28detect+automatically%29&doctype=Inline&ss=1&group=0&user-agent=W3C_Validator%2F1.2#line-920
Can somebody give me a hand with this issue,
thanks
GreyHead 18 Apr, 2011
Hi bveljkovic ,

Have you fixed this? No errors are being shown now.

Bob
bveljkovic 18 Apr, 2011
Actually no. It is fixed, doesnt show validation error because I choose option NO on general setting Upload chronoform JS and CSS file. I sow similar topic and your replies to Tiffany, I think. I checked if it shows error if I validate form but without loading template. It passes. So I guess it must be some js conflict with something else on page. Can form work without uploading css/js files. Can I add some kind of php code in html form code to load css and js files, something similar to what you suggested to tiffany?

here are validation error http://validator.w3.org/check?uri=http%3A%2F%2Fwww.affordablelaundry.com%2Fcustomer-feedback;accept=text%2Fhtml%2Capplication%2Fxhtml%2Bxml%2Capplication%2Fxml%3Bq%3D0.9%2C*%2F*%3Bq%3D0.8;accept-language=en-us%2Cen%3Bq%3D0.5;accept-charset=ISO-8859-1%2Cutf-8%3Bq%3D0.7%2C*%3Bq%3D0.7
thats what I got when I select Yes on General tab, for prompt Load JS and CSS files.
GreyHead 18 Apr, 2011
Hi bveljkovic,

I think if you edit components/com_chronocontact/js/customclasses.js to add HTML comments at the beginning and end <!-- . . . --> then most of these errors will be fixed.

Bob
bveljkovic 18 Apr, 2011
customclasses.js file doesn't exist in js folder
bveljkovic 18 Apr, 2011
Since mentioned above js file was missing I copied whole js folder from another site where also chronoform is installed and paste it into this one, but still nothing. I have tried adding comments in js files at the beginning and at the end of file, but still nothing. Maybe I didn't write down comments properly?
GreyHead 19 Apr, 2011
Hi bveljkovic,

I'm very confused. I don't understand how the ChronoTips class can be causing the validation errors if the file isn't on your site :-(

There are still no quotes showing if I look at the feedback form page.

Bob
bveljkovic 19 Apr, 2011
Yes, it is confusing. But I told you the truth, that file doesnt exist in com_chronocontact/js folder. Maybe it was placed somewhere else. I also wasn't able to see HTML comments I added to this scripts. In which file you "call" (I dont know proper expression) this scripts? Is it in chronocontact.php?
bveljkovic 19 Apr, 2011
The script that cause the error is this com_chronocontact/libraries/includes/JSvalidation2.php,
I have placed comments at the begining and at the end. You can see that in validator report. Still reporting error. I will see more about this comments, maybe I didn't place them properly.
bveljkovic 19 Apr, 2011
Ok. Finally some progress. I have edited above mentioned script like this

<script type="text/javascript">
// <![CDATA[

...

// ]]>
</script>
And it seems to work now. Now I have some more errors that is probably some other script, but I think I can fix it in same way. Tell if this solution is ok, and if form will work fine.
bveljkovic 19 Apr, 2011
And, that is it! Last file to edit was JSCustomClasses.php Everything is valid now and I think everything works fine. How can I buy you a beer? But seriously ...
GreyHead 19 Apr, 2011
Hi bveljkovic,

Oh - apologies for getting the filename wrong :-( I pasted it in from the code and must have deleted the extra JS :-(

Beers, coffees and books always welcome but not required - click the link in my sig below.

Bob
bveljkovic 19 Apr, 2011
I have send you PM - regardig beer.
This topic is locked and no more replies can be posted.