Future-proof the submitForm for use with forms without validation.

We might decide to use it for other submissions than EditForm.
This commit is contained in:
Mateusz Uzdowski 2012-11-19 11:27:15 +13:00
parent 8168a7db09
commit 3f2ddbb3fb

View File

@ -243,7 +243,8 @@ jQuery.noConflict();
$(button).addClass('loading'); $(button).addClass('loading');
// validate if required // validate if required
if(!form.validate()) { var validationResult = form.validate();
if(typeof validationResult!=='undefined' && !validationResult) {
// TODO Automatically switch to the tab/position of the first error // TODO Automatically switch to the tab/position of the first error
statusMessage("Validation failed.", "bad"); statusMessage("Validation failed.", "bad");