SSbits - Home page
Site by Carbon Crayon
Submit a Post >

Snippets - Little bits of code to make you happy

Disable Default JavaScript Behaviours

By default SilverStripe uses bulky and sometimes unwanted JavaScript libraries to handle form validation and AJAX page commenting features. Often you want to disable this behaviour so you can integrate your own JavaScript code. This is easily achieved with the following two lines in you site configuration file:

mysite/_config.php

Validator::set_javascript_validation_handler('none');
PageCommentInterface::set_use_ajax_commenting(false);

Now you are free to add the behaviours you want to your view (templates) without the hassle of unpredictable SilverStripe JavaScript includes.

Hamish Campbell avatar

Hamish Campbell

Hamish is a web developer for Opus International Consultants in New Zealand. He creates tools for managing data online, with a particular interest in geographical information systems. He is also an active contributor to the SilverStripe open source project.

No one has commented on this page yet.

Post a comment ...

You cannot post comments until you have logged in. Login Here.

Advertisement

Site of the Month

Find SSbits on

Top Contributers

Rank Avatar Name
1 article image Aram Balakjian
2 article image Daniel Hensby
3 article image Marcus Dalgren
4 article image Hamish Campbell
5 article image Ty Barho
6 article image njorndare
7 article image Martijn van Nieuwenhoven
8 article image Darren-Lee
9 article image Roman Schmid
10 article image Matt Clegg

View full leaderboard


Advertisement