Merge pull request #968 from silverstripe-droptables/submitform-validation

Future-proof the submitForm for use with forms without validation.
This commit is contained in:
Ingo Schommer 2012-11-22 15:31:51 -08:00
commit e021a190b3

View File

@ -243,7 +243,8 @@ jQuery.noConflict();
$(button).addClass('loading');
// 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
statusMessage("Validation failed.", "bad");