mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-09-30 21:29:23 +02:00
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:
parent
8168a7db09
commit
3f2ddbb3fb
@ -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");
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user