For days, I've been working on form validation. I'm trying to validate a form that has multiple steps.
Nodejs, ES6, Express, and PUG are the technologies I'm using. I'm having trouble coming up with something that works. I believe parsley would do the trick for me, but I'm having trouble getting it to work with NodeJS.
In my.js file, I have the following code (where risk-calc is the id of my form):
$('.form-navigation .next').click(function() {
if ($('#risk-calc').parsley().validate({group: 'block-' + curIndex()}))
navigateTo(curIndex() + 1);
My console error is '$(...).parsley is not a function.'
I've installed via NPM parselyjs and jquery.
edit.
Attempting to use webpack to add global variables.
Something is still wrong, but how does this look?
plugins: [
new ExtractTextPlugin('style.css'),
new webpack.ProvidePlugin({
$: 'jquery',
jQuery: 'jquery',
parsley: 'parsleyjs/dist/parsley.js'
}),