Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Javascript Validation


Go to End


3 Posts   3172 Views

Avatar
animasola

Community Member, 121 Posts

20 December 2009 at 10:32pm

What library does the form validation of Silverstripe use? I am having problems with most of my effects since they use MooTools and it has conflicts with some libraries. I relieved the conflict between mootools and jquery by using the jQuery.noConflict(); function and it allowed my effects to work while viewing the forum or event calendar. But whenever I try logging in or registering, they stop working. My mind tells me it's because of the validator.js that creates the conflict with mootools.

Has anyone encountered the same problem? Is anyone using mootols as well and having trouble? Can I just remove the form validation or create my own from mootools? Where can I find the validation javascript file?

Thanks!

Avatar
tobych

Community Member, 97 Posts

21 December 2009 at 7:24am

The Javascript is included in sapphire/Forms/Validator.php (currently uses Prototype).

Toby

Avatar
Krato

Community Member, 7 Posts

24 April 2010 at 4:31am

To disable javascript validation use:

Validator::set_javascript_validation_handler("none");

This could be called from _config.php to disable site-wide javascript validation, or from ContentController::init() to disable form validation just for that template.

Regards