Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

interoperating with jQuery noConflict() #8

Open
CBCNewMedia opened this issue Nov 25, 2013 · 2 comments
Open

interoperating with jQuery noConflict() #8

CBCNewMedia opened this issue Nov 25, 2013 · 2 comments

Comments

@CBCNewMedia
Copy link

The jQuery function noConflict() removes the global references to jQuery so that you can safely use multiple versions of jQuery on a single page (multiple jQuery libraries is a necessary evil if you're working with a lot of third party embedded content).

The Zebra Form javascript code that is written out to the HTML page depends on the globals jQuery and $. If you're using noConflict(), those won't be available, and the client side validation won't work.

It would be great if we could specify an alternate name for jQuery. That way, we could safely put a reference to jQuery somewhere that Zebra Form can get to it.

Even better would be if all this code could run cleanly inside of a require.js module. We've wrapped up the static Javascript files in a require.js module, but that dynamically generated code is tricky. You would have to build a data structure with all the form's rules and make that available somehow to the require.js module. It's doable, but it's a pretty large change.

@stefangabos
Copy link
Owner

I am open to suggestions - even better, I accept pull requests! :)
Having the code inside a require.js module makes everything too particular, but maybe an extra property given to the clientside_validation method is what we need

@SimonMayerhofer
Copy link

If somebody wants a temporary solution: Just search for "$(" in Zebra_Form.php and replace all with "jQuery(". This did resolve the errors in the console for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants