I have to reflow the Foundation equalizer on a page that contains a form [contact page] - if validation failsthe form will overlap the footer with the added validation error elements.
<script type="text/javascript">
//<![CDATA[
var contactForm = new VarienForm('contactForm', true);
jQuery('#contact-submit').click(function(){
console.log('submitted');
jQuery(document).foundation('equalizer', 'reflow');
});
//]]>
</script>
Obviously this only works after the submit button is clicked a second time.
Is there a callback function [or something] I can use after Magento have validated the form to call the Foundation reflow?
UPDATE
According to some different docs here and there, I'm supposed to be able to do something like this:
<script type="text/javascript">
//<![CDATA[
var contactForm = new VarienForm('contactForm', {onFormValidate: myCallback, immediate : true});
function myCallback(result, form) {
console.log('callback = ' + result);
}
//]]>
</script>
It will validate the form, but does not fire the callback OR validate immediately....