Displaying a "Reveal" modal when validating an "Abide" form
I'm loving the Foundation framework! It's making my life much easier.
I'm running into a problem with creating custom callbacks when an Abide
form runs its validation. Here's the code that I found in the Docs:
$('#myForm')
.on('invalid', function () {
var invalid_fields = $(this).find('[data-invalid]');
console.log(invalid_fields);
});
.on('valid', function () {
console.log('valid!');
});
What I want to do is to display a success modal using Reveal when all
fields validate and an error modal when they don't.
I thought I could simply replace
console.log('valid!');
With...
$("#myModalSuccess").reveal();
But, that doesn't work. I'm sure I'm missing something. I'm guessing I'm
coming at the problem all wrong.
Thoughts?
No comments:
Post a Comment