I've installed version 2.0.9 into my Umbraco 7.1.6 site and all is working well except that I don't have any form validation at all on the comments form - if I hit Submit it litterally posts into Umbraco.
I was doing some work on the layouts and amending the templates and partials and originally thought I'd broken the validation through something that I'd done, but I've since rolled back to a vanilla install testing along the way and then finally uninstalled the package and reinstalled it and still the validation isn't firing.
I installed 2.0.9 into v7.1.6 on a different server originally to test things out and the validation did work so I'm wondering if it may be a server configuration issue on this other server.
Have you any ideas why this might be happening or any suggestions on what to check?
I haven't tried this starter kit myself, but one possibility is that client-side validation isn't configured in the web.config. If the package was built incorrectly, it may rely on client-side validation and fail to validate posted forms on the server side. If it's using the typical way of validating forms in MVC, these would need to be present in the web.config:
You can also check for JavaScript errors in the Chrome developer console. If a JavaScript error causes some click handlers to never be created, any AJAX forms may fallback to simple postback forms, which may also explain some validation issues.
I checked the web.config on both sites - the one where the validation works and the one where it doesn't - and those two entries don't exit, however, the UnobtrusiveJavaScriptEnabled made me think as I'd seen that reference within the starter kit code.
So I checked the Javascript Console in Chrome (brilliant tip by the way!) and it was trying to locate a .js file in the /scripts/ directory which wasn't on the server:
jquery.validate.unobtrusive.min.js
The package hadn't installed this file directly and actually checking the Smart Blog demo site and also my other server (with working validation) there seems to be no immediate reference to this file in the source code, but it does exist within the /script/ directory of the demo site. So I uploaded this file and did some cache-bashing and the validation is now working.
I also seemed to notice that if i'm logged into the Umbraco back-office the validation seems to be bypassed, even with the above file in place, whereas if I log out and clear the browser cache it does work.
But the important thing is the validation is working now so thanks for pointing me in the right direction here! Hugely appreciated.
No validation of comments
Hi Luke,
I've installed version 2.0.9 into my Umbraco 7.1.6 site and all is working well except that I don't have any form validation at all on the comments form - if I hit Submit it litterally posts into Umbraco.
I was doing some work on the layouts and amending the templates and partials and originally thought I'd broken the validation through something that I'd done, but I've since rolled back to a vanilla install testing along the way and then finally uninstalled the package and reinstalled it and still the validation isn't firing.
I installed 2.0.9 into v7.1.6 on a different server originally to test things out and the validation did work so I'm wondering if it may be a server configuration issue on this other server.
Have you any ideas why this might be happening or any suggestions on what to check?
Many thanks,
Mike
I haven't tried this starter kit myself, but one possibility is that client-side validation isn't configured in the web.config. If the package was built incorrectly, it may rely on client-side validation and fail to validate posted forms on the server side. If it's using the typical way of validating forms in MVC, these would need to be present in the web.config:
You can also check for JavaScript errors in the Chrome developer console. If a JavaScript error causes some click handlers to never be created, any AJAX forms may fallback to simple postback forms, which may also explain some validation issues.
Hey Nicholas,
I checked the web.config on both sites - the one where the validation works and the one where it doesn't - and those two entries don't exit, however, the UnobtrusiveJavaScriptEnabled made me think as I'd seen that reference within the starter kit code.
So I checked the Javascript Console in Chrome (brilliant tip by the way!) and it was trying to locate a .js file in the /scripts/ directory which wasn't on the server:
The package hadn't installed this file directly and actually checking the Smart Blog demo site and also my other server (with working validation) there seems to be no immediate reference to this file in the source code, but it does exist within the /script/ directory of the demo site. So I uploaded this file and did some cache-bashing and the validation is now working.
I also seemed to notice that if i'm logged into the Umbraco back-office the validation seems to be bypassed, even with the above file in place, whereas if I log out and clear the browser cache it does work.
But the important thing is the validation is working now so thanks for pointing me in the right direction here! Hugely appreciated.
is working on a reply...