Menu icon Foundation
Asynchronous validation with Abide

I've got a form that needs to be able to check wether the supplied email address has already been registered in the system, asynchronously - is this possible with Abide valiations? The problem I have is that the Abide framework seems to want the result of the validation immediately via the validation function's return value, however if I am doing an async AJAX call then I cannot return the correct value as it isn't available yet. Is there a way around this?

I can make the AJAX call synchronous but then the UI blocks and I really don't want to do that! At the moment I am returning 'true' and then doing the DOM stuff myself in the callback, is there another way to let Abide know the form is invalid from my callback?

abidevalidationAJAXasync

I've got a form that needs to be able to check wether the supplied email address has already been registered in the system, asynchronously - is this possible with Abide valiations? The problem I have is that the Abide framework seems to want the result of the validation immediately via the validation function's return value, however if I am doing an async AJAX call then I cannot return the correct value as it isn't available yet. Is there a way around this?

I can make the AJAX call synchronous but then the UI blocks and I really don't want to do that! At the moment I am returning 'true' and then doing the DOM stuff myself in the callback, is there another way to let Abide know the form is invalid from my callback?

Geoff Kimball about 4 years ago

Abide doesn't support asynchronous validation methods, although it's an interesting idea for a future version of the framework. We have a Trello board where we're adding feedback for Foundation 6, so I'll add it there.